Split
A two-region layout that stacks on small screens and splits into columns once there is room. Fully customisable through a grid template.
Install
Install the component
Add the source straight into your project with the shadcn CLI — no package dependency to track.
npx shadcn@latest add https://vert-ui.dev/r/split.jsonPreview
Live preview
Aside
Stacks below on mobile.
Main
Takes the wider column on desktop.
Usage
Examples
Sidebar and content
Nav
minmax(0,12rem)
Content
minmax(0,1fr)
<Split templateColumns="minmax(0,16rem) minmax(0,1fr)" collapse="lg">
<nav>…</nav>
<main>…</main>
</Split>Equal halves from the small breakpoint
Left
Splits at sm.
Right
Splits at sm.
<Split collapse="sm" templateColumns="1fr 1fr">…</Split>Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| templateColumns | string | "1fr 1fr" | Grid template applied once the layout is wide enough, e.g. "1fr 2fr" or "minmax(0,320px) minmax(0,1fr)". |
| collapse | "none" | "sm" | "md" | "lg" | "md" | Breakpoint at which the regions sit side by side. Below it they stack. |
| gap | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 6 | Gap between the regions. |
| align | "start" | "center" | "end" | "stretch" | "stretch" | Cross-axis alignment of the regions. |
| asChild | boolean | false | Render the child element instead of a div. |
Accessibility
Accessibility notes
- Regions stay in DOM order at every breakpoint, so the stacked mobile layout matches the desktop reading order.
- minmax(0, …) tracks let long content shrink instead of overflowing — important for code blocks and URLs at 320px.
- The template is applied at a media query, not reordered with flex, so focus order and screen-reader order never diverge.