Grid

Layout

Arranges children in a grid layout.

@using Spectre.Console
@using RazorConsole.Components

<Grid Columns="3">
    <Markup Content="Cell 1.1" />
    <Markup Content="Cell 1.2" />
    <Markup Content="Cell 1.3" />
    <Markup Content="Cell 2.1" />
    <Markup Content="Cell 2.2" />
    <Markup Content="Cell 2.3" />
</Grid>

Parameters

4
NameTypeDefaultDescription
Appearance
WidthNullable<Int32>Width of the grid in characters. If null , automatically determined by content.
Common
ChildContentRenderFragmentArranges content in a multi-column grid using Spectre.Console's Grid renderable.
Other
ColumnsInt32Number of columns in the grid. Default is 2. Must be positive.
ExpandBooleanWhether the grid should expand to fill available space. Default is false .

API