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

21
NameTypeDefaultDescription
Behavior
FocusableBoolean—Makes the scroll container a Tab stop that scrolls with the arrow keys, PageUp, PageDown, Home and End. See Focusable.
OverscrollBehaviorOverscrollBehavior—Whether scrolling continues in the parent scroll container once this one reaches its limit. See OverscrollBehavior.
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.
Events
ScrollTopChangedEventCallback<Int32>—Raised when the engine changes the scroll offset.
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
ControllerScrollController—Scrolls this container from code. See Controller.
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.
OverflowOverflowMode—What happens to content taller than the panel. See Overflow.
PaddingPadding?—Padding inside the panel border as (left, top, right, bottom). If null, no padding is applied.
ScrollIdString—Stable identity of the scroll state. See ScrollId.
ScrollTopInt32—Scroll offset in rows, applied when its value changes. See ScrollTop.
ScrollbarScrollbarSettings—How the scrollbar looks and where it is drawn. See Scrollbar.
StickToBottomBoolean—Keeps the end of the content in view while it grows. See StickToBottom.

API