Resizable

Accessible resizable panel groups and layouts.

One
Two
Three

Installation

pnpm dlx cubix@latest add resizable

About

Built on react-resizable-panels for accessible, keyboard-friendly panel layouts.

Usage

Import
import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup,
} from "@/components/cubix/resizable"
Example
<ResizablePanelGroup orientation="horizontal">
  <ResizablePanel>One</ResizablePanel>
  <ResizableHandle />
  <ResizablePanel>Two</ResizablePanel>
</ResizablePanelGroup>

Composition

Use the following composition to build a ResizablePanelGroup:

 
ResizablePanelGroup
├── ResizablePanel
├── ResizableHandle
└── ResizablePanel

Horizontal

Sidebar
Content

Vertical

Use orientation="vertical" for vertical resizing.

Header
Content

Handle

The handle anchor is shown by default in the middle of the separator. Pass withHandle={false} for a plain line only.

Sidebar
Content

Controlled

Track panel sizes with onLayoutChange and stable id values.

30%

API Reference

See also the react-resizable-panels documentation for additional primitive props.

ResizablePanelGroup

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Direction of the panel group layout.
onLayoutChange(layout: Layout) => void-Called when panel sizes change.
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
childrenReact.ReactNode-ResizablePanel and ResizableHandle elements.

ResizablePanel

PropTypeDefaultDescription
defaultSizestring | number-Initial size, such as "50%" or a pixel value.
minSizestring | number-Minimum size the panel can be resized to.
maxSizestring | number-Maximum size the panel can be resized to.
idstring-Stable id used for controlled layouts and persistence.
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
childrenReact.ReactNode-Panel content.

ResizableHandle

PropTypeDefaultDescription
withHandlebooleantrueShows the centered drag anchor on the separator. Set false for a plain line.
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).