Panel
DisplayCreates 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| Name | Type | Default | Description |
|---|---|---|---|
Behavior | |||
Focusable | Boolean | — | Makes the scroll container a Tab stop that scrolls with the arrow keys, PageUp, PageDown, Home and End. See Focusable. |
OverscrollBehavior | OverscrollBehavior | — | Whether scrolling continues in the parent scroll container once this one reaches its limit. See OverscrollBehavior. |
Appearance | |||
Border | BoxBorder | — | Style of the panel border. See BoxBorder for available styles like Rounded, Square, and Double. |
BorderColor | Color? | — | Color of the panel border. If null, uses default console color. |
FillHeight | Boolean | — | Whether the panel should fill the height offered by its parent. |
FillWidth | Boolean | — | Whether the panel should fill the width offered by its parent. |
Height | int? | — | Height of the panel in lines. If null or less than 1, height is automatically determined by content. |
TitleColor | Color? | — | Color of the panel title. If null, uses default console color. |
Width | int? | — | Width of the panel in characters. If null or less than 1, width is automatically determined by content. |
Events | |||
ScrollTopChanged | EventCallback<Int32> | — | Raised when the engine changes the scroll offset. |
Common | |||
ChildContent | RenderFragment | — | Renders a panel with optional title, border, and padding using Spectre.Console's Panel renderable. |
Title | string? | — | Title text displayed at the top of the panel border. If null or empty, no title is shown. |
Other | |||
Controller | ScrollController | — | Scrolls this container from code. See Controller. |
Expand | bool | — | Whether the panel should expand to fill available space. Default is false. |
Margin | Nullable<Padding> | — | Margin outside the panel border as (left, top, right, bottom). If null, no margin is applied. |
Overflow | OverflowMode | — | What happens to content taller than the panel. See Overflow. |
Padding | Padding? | — | Padding inside the panel border as (left, top, right, bottom). If null, no padding is applied. |
ScrollId | String | — | Stable identity of the scroll state. See ScrollId. |
ScrollTop | Int32 | — | Scroll offset in rows, applied when its value changes. See ScrollTop. |
Scrollbar | ScrollbarSettings | — | How the scrollbar looks and where it is drawn. See Scrollbar. |
StickToBottom | Boolean | — | Keeps the end of the content in view while it grows. See StickToBottom. |