Split

Two-pane layout with a keyboard and pointer resizable separator.

Also known as: split pane, resizable panes, splitter

Installation

Install with the CLI, or copy the component source into your project.

Add split (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add split

Properties

Two-pane layout with a keyboard and pointer resizable separator. Pass exactly two children as primary and secondary panes.

Split

PropTypeDefaultNotes
orientation"horizontal" | "vertical""horizontal"horizontal splits left and right. vertical splits top and bottom.
rationumber-Controlled primary pane share as a unit ratio (0 to 1) or a percentage greater than 1.
defaultRationumber0.5Uncontrolled initial ratio. Double-clicking the divider restores this value.
onRatioChange(ratio: number) => void-Called with the clamped unit ratio after each change.
minSizenumber | `${number}%` | { px: number }-Minimum primary pane size as a unit ratio, percent string, or pixel object.
maxSizenumber | `${number}%` | { px: number }-Maximum primary pane size as a unit ratio, percent string, or pixel object.
stepnumber0.02Arrow-key step as a unit ratio.
disabledbooleanfalseLocks the divider and removes it from the tab order.
children[ReactNode, ReactNode]-Primary pane first, secondary pane second.
classNamestring-Additional styles on the root.

Keyboard and accessibility

Separator (role="separator"): The divider exposes aria-orientation and aria-valuenow, min, and max as percentages. Arrow keys step the ratio; Home and End jump to the bounds. There is no name prop on the separator; it may lack a spoken label until the kit adds one.