Split
Two columns at a set proportion that stack below a breakpoint. Sidebars, settings pages and media with text.
General
Workspace name, default region and the timezone used for reports.
Installation
pnpm dlx nachui add splitAnatomy
Split is a two column grid. ratio is the share of the first column, collapse is the breakpoint below which the columns stack into one. Both children keep min-width: 0, so long content wraps instead of pushing the layout wider. It is different from Separator, which draws a line.Examples
Default
A settings page: navigation on the left at one third, content on the right.
General
Workspace name, default region and the timezone used for reports.
Ratios
auto sizes the first column to its content, auto-end does the same for the second.1/2
rest
1/3
rest
2/3
rest
1/4
rest
auto
rest
Reverse
reverse moves the first child below the second when the columns stack, for an image that should lead on mobile but sit beside the text on desktop.Preview every branch
Each pull request gets its own URL, seeded with a copy of staging data. On small screens the image moves above this text.
API Reference
Split
| Prop | Type | Default | Description |
|---|---|---|---|
ratio | '1/2' | '1/3' | '2/3' | '1/4' | '3/4' | 'auto' | 'auto-end' | '1/2' | Share of the first column |
collapse | 'none' | 'sm' | 'md' | 'lg' | 'md' | Below this breakpoint the columns stack |
gap | '0' | '2' | '3' | '4' | '6' | '8' | '10' | '12' | '16' | '6' | Gap between the columns |
align | 'start' | 'center' | 'end' | 'stretch' | 'stretch' | Vertical alignment of the columns |
reverse | boolean | false | Put the first child last while stacked |
as | React.ElementType | 'div' | Element to render |
className | string | - | Additional CSS classes |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.