Resizable Panels

Horizontal or vertical split panes with pointer-captured drag handles, per-panel min/max sizes, collapsible panels that spring shut below a threshold, double-click reset, nestable layouts, and keyboard-resizable separators.

Preview

Resizable Panels preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/resizable-panels
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

ResizablePanel

defaultSize?
number

Initial size in percent. Panels without one share what is left.

—
minSize?
number

Minimum size in percent while expanded.

—
maxSize?
number

Maximum size in percent.

—
collapsible?
boolean

Snap shut when dragged below `collapseThreshold`.

—
collapsedSize?
number

Size in percent the panel rests at when collapsed.

—
collapseThreshold?
number

Drag below this size (percent) to collapse. Defaults to half of `minSize`.

—
handleLabel?
string

Accessible name for the handle that resizes this panel (the handle after it).

—
className?
string
—

ResizablePanels

direction?
"horizontal" | "vertical"
horizontal
sizes?
number[]

Sizes in percent (controlled), one per panel, summing to 100.

—
defaultSizes?
number[]

Overrides each panel's `defaultSize`.

—
onSizesChange?
((sizes: number[]) => void)
—
withHandle?
boolean

Show a grip pill on each handle.

true
className?
string
—
children
ReactNode

`ResizablePanel` elements. Handles are inserted between them.

—

Updated