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')->variant(ButtonVariant::Default), Button::make('Cancel')->variant(ButtonVariant::Ghost),]);- align:null
- direction:"row"
- float:null
- gap:"sm"
- height:null
- justify:null
- width:null
- buttonType:"button"
- effects:[]
- href:null
- icon:null
- label:"Save"
- variant:"default"
- buttonType:"button"
- effects:[]
- href:null
- icon:null
- label:"Cancel"
- variant:"ghost"
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(n) lays children out in n equal columns.
Grid::make()->columns(3)->schema([ Badge::make('First'), Badge::make('Second'), Badge::make('Third'),]);- columns:3
- label:"First"
- label:"Second"
- label:"Third"
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.')->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."
- 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
- level:2
- text:"Members"
- tooltip:null
- align:null
- color:"muted"
- copyable:false
- size:"md"
- text:"Three people have access to this team."
- label:"3 active"
- buttonType:"button"
- effects:[]
- href:null
- icon:null
- label:"Invite member"
- variant:"default"