Components › Display

Resizable panels

Two panels with a handle between them that you drag or move with the arrow keys.

Installation

npx plankui@latest add resizable

Usage

import { Resizable } from "@/components/ui/resizable";

<Resizable label="sidebar" defaultSize={30}>{[<Sidebar />, <Main />]}</Resizable>

API reference

PropTypeDefaultDescription
children[ReactNode, ReactNode]requiredThe two panels; the first one resizes.
direction"horizontal" | "vertical""horizontal"Side by side, or stacked.
defaultSizenumber50First panel's size in percent.
min / maxnumber15 / 85Limits in percent.
onResize(size: number) => voidCalled with the new size.
labelstring"panel"Name of the first panel, for the handle's label.

View the source on GitHub