Resizable
Accessible resizable panel groups and layouts.
One
Two
Three
Installation
pnpm dlx cubix@latest add resizable --base radixAbout
Built on react-resizable-panels for accessible, keyboard-friendly panel layouts.
Usage
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/components/cubix/resizable"<ResizablePanelGroup orientation="horizontal">
<ResizablePanel>One</ResizablePanel>
<ResizableHandle />
<ResizablePanel>Two</ResizablePanel>
</ResizablePanelGroup>Composition
Use the following composition to build a ResizablePanelGroup:
ResizablePanelGroup
├── ResizablePanel
├── ResizableHandle
└── ResizablePanelHorizontal
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%
70%
API Reference
See also the react-resizable-panels documentation for additional primitive props.
ResizablePanelGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | "horizontal" | Direction of the panel group layout. |
| onLayoutChange | (layout: Layout) => void | - | Called when panel sizes change. |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| children | React.ReactNode | - | ResizablePanel and ResizableHandle elements. |
ResizablePanel
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultSize | string | number | - | Initial size, such as "50%" or a pixel value. |
| minSize | string | number | - | Minimum size the panel can be resized to. |
| maxSize | string | number | - | Maximum size the panel can be resized to. |
| id | string | - | Stable id used for controlled layouts and persistence. |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| children | React.ReactNode | - | Panel content. |
ResizableHandle
| Prop | Type | Default | Description |
|---|---|---|---|
| withHandle | boolean | true | Shows the centered drag anchor on the separator. Set false for a plain line. |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |