Panel

Display

Creates a bordered panel with optional title.

@using Spectre.Console
@using RazorConsole.Components

<Panel Title="Information" BorderColor="Color.Blue" Expand="true">
    <Markup Content="Panel content here" />
</Panel>

Parameters

12
NameTypeDefaultDescription
Appearance
BorderBoxBorder—Style of the panel border. See BoxBorder for available styles like Rounded, Square, and Double.
BorderColorColor?—Color of the panel border. If null, uses default console color.
FillHeightBoolean—Whether the panel should fill the height offered by its parent.
FillWidthBoolean—Whether the panel should fill the width offered by its parent.
Heightint?—Height of the panel in lines. If null or less than 1, height is automatically determined by content.
TitleColorColor?—Color of the panel title. If null, uses default console color.
Widthint?—Width of the panel in characters. If null or less than 1, width is automatically determined by content.
Common
ChildContentRenderFragment—Renders a panel with optional title, border, and padding using Spectre.Console's Panel renderable.
Titlestring?—Title text displayed at the top of the panel border. If null or empty, no title is shown.
Other
Expandbool—Whether the panel should expand to fill available space. Default is false.
MarginNullable<Padding>—Margin outside the panel border as (left, top, right, bottom). If null, no margin is applied.
PaddingPadding?—Padding inside the panel border as (left, top, right, bottom). If null, no padding is applied.

API