API Reference
Panel
A bordered box with a title in the top edge, an optional caption on the right of the top edge (counts, clocks) and an optional footer in the bottom edge. Borders follow the glyph tier (rounded on Full, single on Basic, +-| on Ascii). Inside a Columns row, panels stretch to the row height.
Inheritance
- Object
- Panel
Usage
Explore 45 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 23
- Extension method Panel.WithBorder
- Extension method Panel.WithBorderToken
- Extension method Panel.WithCaption
- Extension method Panel.WithExpand
- Extension method Panel.WithFooter
- Extension method Panel.WithHeight
- Extension method Panel.WithPaddingBottom
- Extension method Panel.WithPaddingLeft
- Extension method Panel.WithPaddingRight
- Extension method Panel.WithPaddingTop
- Extension method Panel.WithTitle
- Method PanelFluent.WithBorder
- Method PanelFluent.WithBorderToken
- Method PanelFluent.WithCaption
- Method PanelFluent.WithExpand
- Method PanelFluent.WithFooter
- Method PanelFluent.WithHeight
- Method PanelFluent.WithPaddingBottom
- Method PanelFluent.WithPaddingLeft
- Method PanelFluent.WithPaddingRight
- Method PanelFluent.WithPaddingTop
- Method PanelFluent.WithTitle
- Method Ui.Panel
Accepted by parameters 22
- Extension method Panel.WithBorder
- Extension method Panel.WithBorderToken
- Extension method Panel.WithCaption
- Extension method Panel.WithExpand
- Extension method Panel.WithFooter
- Extension method Panel.WithHeight
- Extension method Panel.WithPaddingBottom
- Extension method Panel.WithPaddingLeft
- Extension method Panel.WithPaddingRight
- Extension method Panel.WithPaddingTop
- Extension method Panel.WithTitle
- Method PanelFluent.WithBorder
- Method PanelFluent.WithBorderToken
- Method PanelFluent.WithCaption
- Method PanelFluent.WithExpand
- Method PanelFluent.WithFooter
- Method PanelFluent.WithHeight
- Method PanelFluent.WithPaddingBottom
- Method PanelFluent.WithPaddingLeft
- Method PanelFluent.WithPaddingRight
- Method PanelFluent.WithPaddingTop
- Method PanelFluent.WithTitle
Constructors
public Panel(IWidget child, RichText title) #Creates a panel with a multicolour title.
Parameters
- child ConsoleMonster.Layout.IWidget
- The content.
- title ConsoleMonster.Text.RichText
- The title.
public Panel(IWidget child, String? title = null) #Creates a panel around a child with an optional title (markup).
Parameters
- child ConsoleMonster.Layout.IWidget
- The child.
- title System.String? = null
- The title, or null.
Methods
public Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public Void Render(Region region, RenderContext context) #VoidRenders 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.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public String? Caption { get; set; } #Text on the right of the top edge (markup), for example a count or a clock.
public ThemeToken BorderToken { get; set; } #The theme token for the border (default ThemeToken.Border).
public Int32 PaddingLeft { get; set; } #Cells between the left border and the content (default 1).
public Int32 PaddingRight { get; set; } #Cells between the content and the right border (default 1).
public Int32 PaddingTop { get; set; } #Rows between the top border and the content (default 0).
public Int32 PaddingBottom { get; set; } #Rows between the content and the bottom border (default 0).
public Boolean Expand { get; set; } #Whether the panel takes the full available width (default true).
public Int32? Height { get; set; } #A fixed total height including borders, or null to fit the content.
Extension Methods
public static Panel WithBorder(Panel panel, BoxStyle value) #PanelSets Panel.Border: The border style (default rounded).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value ConsoleMonster.Glyphs.BoxStyle
- The value.
Returns
The same instance.
public static Panel WithBorderToken(Panel panel, ThemeToken value) #PanelSets Panel.BorderToken: The theme token for the border (default ThemeToken.Border).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value ConsoleMonster.Styling.ThemeToken
- The value.
Returns
The same instance.
public static Panel WithCaption(Panel panel, String? value) #PanelSets Panel.Caption: Text on the right of the top edge (markup), for example a count or a clock.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static Panel WithExpand(Panel panel, Boolean value = true) #PanelSets Panel.Expand: Whether the panel takes the full available width (default true).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static Panel WithHeight(Panel panel, Int32? value) #PanelSets Panel.Height: A fixed total height including borders, or null to fit the content.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.Int32?
- The value.
Returns
The same instance.
public static Panel WithPaddingBottom(Panel panel, Int32 value) #PanelSets Panel.PaddingBottom: Rows between the content and the bottom border (default 0).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Panel WithPaddingLeft(Panel panel, Int32 value) #PanelSets Panel.PaddingLeft: Cells between the left border and the content (default 1).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Panel WithPaddingRight(Panel panel, Int32 value) #PanelSets Panel.PaddingRight: Cells between the content and the right border (default 1).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Panel WithPaddingTop(Panel panel, Int32 value) #PanelSets Panel.PaddingTop: Rows between the top border and the content (default 0).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Panel WithTitle(Panel panel, String? value) #PanelSets Panel.Title: The title shown in the top edge (markup).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value System.String?
- The value.
Returns
The same instance.