Responsive
ConsoleMonster.Layout
Shows one of several layouts by the width it is given: the widest breakpoint that fits, otherwise the fallback. Use it when a view needs a different shape, not just a narrower one, such as one cell per server on a wide terminal and one cell per site on a narrow one. Every layout stays a child, so live updates reach the hidden ones too and a resize shows current values.
Inheritance
- object
- Responsive
Usage
Explore 5 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 3
- Method LayoutFluent.Fallback
- Extension method Responsive.Fallback
- Method Responsive.When
Accepted by parameters 2
- Method LayoutFluent.Fallback
- Extension method Responsive.Fallback
Constructors
public Responsive(IWidget fallback) #Creates a responsive container.
Parameters
- fallback ConsoleMonster.Layout.IWidget
- The layout shown below every breakpoint.
Methods
public Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public Responsive When(int minWidth, IWidget content) #Adds a layout shown when at least minWidth cells are available; a second layout for the same width replaces the first.
Parameters
- minWidth int
- The narrowest width, in cells, for this layout.
- content ConsoleMonster.Layout.IWidget
- The layout.
Inherited Methods
Properties
Extension Methods
public static Responsive Fallback(Responsive responsive, IWidget value) #Sets Responsive.Fallback: The layout shown below every breakpoint.
Parameters
- responsive ConsoleMonster.Layout.Responsive
- The instance.
- value ConsoleMonster.Layout.IWidget
- The value.
Examples
// C# initializer or property // C# fluent
responsive.Fallback = value; responsive.Fallback(value);