Split
Type
Field
Resizes two adjacent panes with a draggable 1px handle. Arrow keys adjust the split.
Type
Field
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { Split } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/resizable.
npx @noorddev/vlak-cli add resizable
The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/resizable.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { Split } from "@noorddev/vlak-react";
<Split initial={60} min={30} max={80} handleLabel="Resize editor and preview">
<Editor />
<Preview />
</Split>Two panes on a draggable hairline. Arrows step, Home/End jump; the axis follows the layout.
| Prop | Type | Default | Description |
|---|---|---|---|
initial | number | 50 | Starting share of the first pane, in percent. |
min | number | 20 | |
max | number | 80 | |
handleLabel | string | "Resize panes" | Accessible name of the handle. |
childrenrequired | [ReactNode, ReactNode] |
Also accepts HTMLAttributes<HTMLDivElement>.
| Keys | Does |
|---|---|
| Tab | Focuses the handle |
| Arrow left, Arrow up | Shrinks the first pane by 2% |
| Arrow right, Arrow down | Grows it by 2% |
| Shift + Arrow keys | Moves by 10% |
| Home, End | Jumps to min or max |
<div class="rs-split"><div class="rs-split-pane" style="width:50%">Left</div><button class="rs-split-handle" role="separator" aria-valuenow="50"></button><div class="rs-split-pane" style="width:50%">Right</div></div>