Layout
Layout components arrange their children. They are containers — pass children to ->schema([...]),
and nest them freely. This page covers the three you reach for most; the disclosures
(Section & Collapsible) and the corner-pinned
Floating panel have their own pages.
Stack::make() lays children out in one direction with a consistent gap. It defaults to a vertical
column; pass ->direction('row') to lay them out horizontally.
Stack::make()->direction('row')->gap(Gap::Small)->schema([ Button::make('Save'), Button::make('Cancel')->emphasis(Emphasis::Ghost),]);- align:null
- direction:"row"
- float:null
- gap:"sm"
- height:null
- justify:null
- width:null
- action:null
- buttonType:"button"
- effects:[]
- emphasis:null
- href:null
- icon:null
- label:"Save"
- method:null
- variant:null
- action:null
- buttonType:"button"
- effects:[]
- emphasis:"ghost"
- href:null
- icon:null
- label:"Cancel"
- method:null
- variant:null
Tune the layout with enum-typed options (see the enums reference):
->gap(Gap::ExtraSmall … ExtraLarge)— the space between children.->align(Align::…)and->justify(Justify::…)— cross-axis and main-axis alignment.->width(Width::…)and->height(Height::…)— sizing.->float(Side::…)— float the stack to one side.
Grid::make()->columns(…) lays children out in a responsive CSS grid:
->columns(3)— three equal columns from themdbreakpoint up, one column below.->columns(['default' => 1, 'md' => 2, 'xl' => 4])— an explicit count per breakpoint (default,sm,md,lg,xl,2xl), mobile-first: each value applies from its breakpoint up until a larger breakpoint overrides it.->columns('2fr 1fr 1fr 1fr')— a rawgrid-template-columnstrack list for unequal columns, e.g. one wide plus three narrow. Track lists work inside breakpoint maps too.
Any child component or field controls how many columns it covers with ->columnSpan(n)
(from md up), a breakpoint map, or ->columnSpanFull() to stretch across the whole row.
Grid::make()->columns(3)->schema([ Badge::make('Wide')->columnSpan(2), Badge::make('Narrow'), Badge::make('Full width')->columnSpanFull(),]);- columns:{"md":3}
- color:null
- columnSpan:{"md":2}
- label:"Wide"
- color:null
- label:"Narrow"
- color:null
- columnSpan:{"default":"full"}
- label:"Full width"
Card::make('Title', 'Description') wraps children in a bordered panel. Both arguments are optional —
omit them for a plain panel. Call ->tooltip('…') to attach an ⓘ info popover next to the title; its
content is trusted HTML and may include links.
Card::make('Team settings', 'Manage how your team appears.') ->tooltip('These settings affect everyone on the team.') ->schema([ Stack::make()->gap(Gap::Small)->schema([ Heading::make('Members', 2), Text::make('Three people have access to this team.'), Badge::make('3 active'), ]), Button::make('Invite member'), ]);- description:"Manage how your team appears."
- headerActions:[]
- title:"Team settings"
- tooltip:"These settings affect everyone on the team."
- align:null
- direction:null
- float:null
- gap:"sm"
- height:null
- justify:null
- width:null
- copyable:false
- level:2
- text:"Members"
- tooltip:null
- align:null
- color:null
- copyable:false
- size:"md"
- text:"Three people have access to this team."
- color:null
- label:"3 active"
- action:null
- buttonType:"button"
- effects:[]
- emphasis:null
- href:null
- icon:null
- label:"Invite member"
- method:null
- variant:null