Panel

Class

For examples and usage details, see the component documentation.

View Panel Component
Namespace: RazorConsole.Components
Assembly: RazorConsole.Core

Definition

public class Panel : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender

Constructors

1
NameTypeDescription
Panel()Constructor—

Properties

12
NameTypeDescription
Appearance
BorderBoxBorderStyle of the panel border. See BoxBorder for available styles like Rounded, Square, and Double.
BorderColorNullable<Color>Color of the panel border. If null, uses default console color.
FillHeightBooleanWhether the panel should fill the height offered by its parent.
FillWidthBooleanWhether the panel should fill the width offered by its parent.
HeightNullable<Int32>Height of the panel in lines. If null or less than 1, height is automatically determined by content.
TitleColorNullable<Color>Color of the panel title. If null, uses default console color.
WidthNullable<Int32>Width of the panel in characters. If null or less than 1, width is automatically determined by content.
Common
ChildContentRenderFragmentRenders a panel with optional title, border, and padding using Spectre.Console's Panel renderable.
TitleStringTitle text displayed at the top of the panel border. If null or empty, no title is shown.
Other
ExpandBooleanWhether 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.
PaddingNullable<Padding>Padding inside the panel border as (left, top, right, bottom). If null, no padding is applied.

Methods

1
NameTypeDescription
BuildRenderTree(RenderTreeBuilder)()MethodRenders the component to the supplied RenderTreeBuilder.