Import
Basic Usage
Props
1 | 2 | 3
required
Number of columns in the layout. Must match the exact number of
Layout.Column children.The component will throw a development error if the column count doesn’t match the number of children.string
Optional header title displayed above the layout
React.ReactNode[]
Array of action components (typically buttons) displayed in the header on the right side.
4 | 6 | 8
default:"4"
Gap between columns in Tailwind spacing units:
4= 16px (1rem)6= 24px (1.5rem)8= 32px (2rem)
string
Additional CSS classes for the layout container
React.ReactNode
required
Layout.Column components. The number of columns must match the
columns prop.Layout.Column Props
string
Additional CSS classes for the column
React.ReactNode
Content to render inside the column
Column Configurations
1 Column Layout
Always displays as a single full-width column at all screen sizes.- Simple list views
- Full-width forms
- Dashboard pages with stacked sections
2 Column Layout
Main content area with a fixed-width sidebar.- Mobile (< 1024px): Columns stack vertically
- Desktop (≥ 1024px): Side-by-side layout
- First column: Flexible width (grows to fill space)
- Second column: Fixed 280px minimum width
- Detail pages with metadata sidebar
- Forms with related information panel
- Document viewers with properties panel
3 Column Layout
Flexible middle column with fixed-width sidebars on both sides.- Mobile (< 1280px): All columns stack vertically
- Desktop (≥ 1280px): Three columns side-by-side
- First column: Fixed 320px minimum width
- Second column: Flexible width (grows to fill space)
- Third column: Fixed 280px minimum width
- Complex dashboards
- Advanced editing interfaces
- Multi-panel configuration pages
Header with Actions
Add a title and action buttons to the layout:Usage in Resources
Use Layout in your resource component definitions:Common Patterns
Form with Sidebar
Typical pattern for edit/create pages:Dashboard with Widgets
Stacked Sections
Custom Column Spacing
TypeScript
The component exports TypeScript types:Validation
In development mode, the Layout component validates that the number ofLayout.Column children matches the columns prop:
Styling
Columns automatically include vertical spacing between child elements:Best Practices
- Match Column Count: Always ensure the number of
Layout.Columnchildren matches thecolumnsprop - Use Semantic Structure: Use 2-column layouts for main/sidebar patterns, 3-column for complex dashboards
- Consider Mobile: Remember that columns stack vertically on mobile - order content accordingly
- Consistent Spacing: Use the
gapprop instead of adding margins to columns - Header Actions: Place primary actions last in the actions array (rightmost position)
Accessibility
The Layout component:- Uses semantic HTML structure
- Maintains logical reading order when columns stack
- Respects user font size preferences
- Works with keyboard navigation