Skip to main content
The Layout component provides responsive column layouts commonly used in ERP applications. It handles 1, 2, or 3 column configurations with automatic responsive behavior.

Why Use the Layout Component?

ERP applications often need structured layouts for:
  • Detail pages with a main content area and sidebar
  • Forms with primary fields and metadata panels
  • Three-column views with navigation, content, and properties
The Layout component provides:
  • Container-based responsiveness - Adapts to parent container width, not viewport
  • Consistent spacing - Standardized gaps and padding
  • Header support - Built-in title and action buttons
  • Accessibility - Proper semantic HTML structure

Basic Usage

One Column Layout

Use for simple, full-width content:

Two Column Layout

Perfect for detail pages with a sidebar:
Responsive behavior:
  • Desktop (≥1024px): Two columns side-by-side
  • Mobile (<1024px): Columns stack vertically

Three Column Layout

Ideal for complex data entry or property panels:
Responsive behavior:
  • Large (≥1200px): All 3 columns side-by-side
  • Medium (960-1199px): Columns 2 & 3 on top row, Column 1 below
  • Small (<960px): All columns stack (order: 3, 2, 1 from top to bottom)

Adding Headers and Actions

The Layout component includes built-in header support with title and action buttons:
Action buttons automatically appear in the header on desktop and stack responsively on mobile.

Real-World Example: Purchase Order Detail

Here’s a complete example from the App Shell source code:

Customizing Gap Spacing

Control spacing between columns with the gap prop:
The gap prop accepts Tailwind spacing values: 4 (16px), 6 (24px), or 8 (32px).

Combining with DescriptionCard

The DescriptionCard component works perfectly inside Layout columns. Here’s a two-column edit page:

Best Practices

Container Responsiveness: The Layout component responds to its container width, not the viewport. This means it works correctly even when nested inside narrow containers.

When to Use Each Column Count

  • 1 Column: Simple content, documentation, lists
  • 2 Columns: Detail pages with sidebar, forms with metadata
  • 3 Columns: Complex editors, property panels, advanced filters

Content Guidelines

  • Keep the main content in the middle column for 3-column layouts
  • Use fixed-width columns (1st and 3rd) for navigation or metadata
  • Put the most important content in Column 1 for 2-column layouts
  • Avoid nesting Layout components (use DescriptionCard instead)

Accessibility

  • Always provide a meaningful title prop
  • Use semantic HTML inside columns
  • Ensure action buttons have clear labels
  • Test keyboard navigation through all interactive elements

Advanced: Custom Layout Components

If you need a layout that doesn’t fit the 1-2-3 column pattern, you can create your own using the SidebarLayout children prop:
See SidebarLayout component for more details.