Skip to main content
The Layout component provides a responsive column-based layout system for building application pages. It supports 1, 2, or 3 column layouts with automatic responsive behavior and optional header sections.

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.
Use cases:
  • Simple list views
  • Full-width forms
  • Dashboard pages with stacked sections

2 Column Layout

Main content area with a fixed-width sidebar.
Responsive behavior:
  • 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
Use cases:
  • 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.
Responsive behavior:
  • 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
Use cases:
  • 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 of Layout.Column children matches the columns prop:

Styling

Columns automatically include vertical spacing between child elements:
Add custom styles to columns:

Best Practices

  1. Match Column Count: Always ensure the number of Layout.Column children matches the columns prop
  2. Use Semantic Structure: Use 2-column layouts for main/sidebar patterns, 3-column for complex dashboards
  3. Consider Mobile: Remember that columns stack vertically on mobile - order content accordingly
  4. Consistent Spacing: Use the gap prop instead of adding margins to columns
  5. 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