Panel
ConsoleMonster.Layout
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 64 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 31
- Extension method Panel.Border
- Extension method Panel.BorderRole
- Extension method Panel.Caption
- Extension method Panel.Content
- Extension method Panel.Expand
- Extension method Panel.Gap
- Extension method Panel.HeaderRight
- Extension method Panel.Height
- Extension method Panel.PaddingBottom
- Extension method Panel.PaddingLeft
- Extension method Panel.PaddingRight
- Extension method Panel.PaddingTop
- Extension method Panel.Status
- Extension method Panel.Title
- Extension method Panel.Verdict
- Method PanelFluent.Border
- Method PanelFluent.BorderRole
- Method PanelFluent.Caption
- Method PanelFluent.Content
- Method PanelFluent.Expand
- Method PanelFluent.Gap
- Method PanelFluent.HeaderRight
- Method PanelFluent.Height
- Method PanelFluent.PaddingBottom
- Method PanelFluent.PaddingLeft
- Method PanelFluent.PaddingRight
- Method PanelFluent.PaddingTop
- Method PanelFluent.Status
- Method PanelFluent.Title
- Method PanelFluent.Verdict
- Method Ui.Panel
Accepted by parameters 33
- Method ContentBuilder.Panel
- Method ContentBuilder.Panel
- Extension method Panel.Border
- Extension method Panel.BorderRole
- Extension method Panel.Caption
- Extension method Panel.Content
- Extension method Panel.Expand
- Extension method Panel.Gap
- Extension method Panel.HeaderRight
- Extension method Panel.Height
- Extension method Panel.PaddingBottom
- Extension method Panel.PaddingLeft
- Extension method Panel.PaddingRight
- Extension method Panel.PaddingTop
- Extension method Panel.Status
- Extension method Panel.Title
- Extension method Panel.Verdict
- Method PanelFluent.Border
- Method PanelFluent.BorderRole
- Method PanelFluent.Caption
- Method PanelFluent.Content
- Method PanelFluent.Expand
- Method PanelFluent.Gap
- Method PanelFluent.HeaderRight
- Method PanelFluent.Height
- Method PanelFluent.PaddingBottom
- Method PanelFluent.PaddingLeft
- Method PanelFluent.PaddingRight
- Method PanelFluent.PaddingTop
- Method PanelFluent.Status
- Method PanelFluent.Title
- Method PanelFluent.Verdict
- Method Ui.Panel
Constructors
public Panel(IWidget content, RichText title) #Creates a panel with a multicolour title.
Parameters
- content ConsoleMonster.Layout.IWidget
- The content.
- title ConsoleMonster.Text.RichText
- The title.
public Panel(IWidget? content = null, string? title = null) #Creates a panel around a content with an optional title (markup).
Parameters
- content ConsoleMonster.Layout.IWidget? = null
- The content.
- title string? = null
- The title, or null.
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.
Inherited Methods
Properties
public int Gap { get; set; } #Blank rows between content children when the content is several widgets, as a report usually is (default 0).
public string? HeaderRight { get; set; } #Text on the right of the top edge (markup), for example a count or a clock.
public string? Caption { get; set; } #Text on the right of the bottom edge (markup), for example "+12 more".
public ThemeToken BorderRole { get; set; } #The theme token for the border (default ThemeToken.Border).
public bool Verdict { get; set; } #Uses a double border and a centred title for a verdict.
public StatusKind? Status { get; set; } #Optional status colour and title glyph for a verdict.
public int PaddingLeft { get; set; } #Cells between the left border and the content (default 1).
public int PaddingRight { get; set; } #Cells between the content and the right border (default 1).
public int PaddingTop { get; set; } #Rows between the top border and the content (default 0).
public int PaddingBottom { get; set; } #Rows between the content and the bottom border (default 0).
public bool Expand { get; set; } #Whether the panel takes the full available width (default true).
public int? Height { get; set; } #A fixed total height including borders, or null to fit the content.
Extension Methods
public static Panel Border(Panel panel, BoxStyle value) #Sets Panel.Border: The border style (default rounded).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value ConsoleMonster.Glyphs.BoxStyle
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Border = value }; Ui.Panel().Border(value);public static Panel BorderRole(Panel panel, ThemeToken value) #Sets Panel.BorderRole: The theme token for the border (default ThemeToken.Border).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value ConsoleMonster.Styling.ThemeToken
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { BorderRole = value }; Ui.Panel().BorderRole(value);public static Panel Caption(Panel panel, string? value) #Sets Panel.Caption: Text on the right of the bottom edge (markup), for example "+12 more".
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Caption = value }; Ui.Panel().Caption(value);public static Panel Content(Panel panel, IWidget content) #Configures this container's content before session ownership.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- content ConsoleMonster.Layout.IWidget
- The widget or nested content builder.
public static Panel Content(Panel panel, Action<ContentBuilder> content) #Configures this container's content before session ownership.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- content System.Action<ConsoleMonster.Layout.ContentBuilder>
- The widget or nested content builder.
public static Panel Expand(Panel panel, bool value = true) #Sets Panel.Expand: Whether the panel takes the full available width (default true).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Expand = value }; Ui.Panel().Expand(value);public static Panel Gap(Panel panel, int value) #Sets Panel.Gap: Blank rows between content children when the content is several widgets, as a report usually is (default 0).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Gap = value }; Ui.Panel().Gap(value);public static Panel HeaderRight(Panel panel, string? value) #Sets Panel.HeaderRight: Text on the right of the top edge (markup), for example a count or a clock.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { HeaderRight = value }; Ui.Panel().HeaderRight(value);public static Panel Height(Panel panel, int? value) #Sets Panel.Height: A fixed total height including borders, or null to fit the content.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value int?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Height = value }; Ui.Panel().Height(value);public static Panel PaddingBottom(Panel panel, int value) #Sets Panel.PaddingBottom: Rows between the content and the bottom border (default 0).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { PaddingBottom = value }; Ui.Panel().PaddingBottom(value);public static Panel PaddingLeft(Panel panel, int value) #Sets Panel.PaddingLeft: Cells between the left border and the content (default 1).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { PaddingLeft = value }; Ui.Panel().PaddingLeft(value);public static Panel PaddingRight(Panel panel, int value) #Sets Panel.PaddingRight: Cells between the content and the right border (default 1).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { PaddingRight = value }; Ui.Panel().PaddingRight(value);public static Panel PaddingTop(Panel panel, int value) #Sets Panel.PaddingTop: Rows between the top border and the content (default 0).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { PaddingTop = value }; Ui.Panel().PaddingTop(value);public static Panel Status(Panel panel, StatusKind? value) #Sets Panel.Status: Optional status colour and title glyph for a verdict.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value ConsoleMonster.Styling.StatusKind?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Status = value }; Ui.Panel().Status(value);public static Panel Title(Panel panel, string? value) #Sets Panel.Title: The title shown in the top edge (markup).
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Title = value }; Ui.Panel().Title(value);public static Panel Verdict(Panel panel, bool value = true) #Sets Panel.Verdict: Uses a double border and a centred title for a verdict.
Parameters
- panel ConsoleMonster.Layout.Panel
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Panel { Verdict = value }; Ui.Panel().Verdict(value);