Command Palette

Search for a command to run...

Resizable

Resizable panels with draggable handles for flexible layouts.

Panel One
Panel Two

Installation

npm i @radix-ui/react-resizable

Usage

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from "@/components/ui/resizable" export function ResizableDemo() { return ( <ResizablePanelGroup direction="horizontal" className="min-h-[200px] max-w-md rounded-lg border" > <ResizablePanel defaultSize={50}> <div className="flex h-full items-center justify-center p-6"> <span className="font-semibold">Panel One</span> </div> </ResizablePanel> <ResizableHandle /> <ResizablePanel defaultSize={50}> <div className="flex h-full items-center justify-center p-6"> <span className="font-semibold">Panel Two</span> </div> </ResizablePanel> </ResizablePanelGroup> ) }

Examples

Vertical Layout

Top Panel
Bottom Panel

Multiple Panels

Panel One
Panel Two
Panel Three

Props

ComponentPropsDescription
ResizablePanelGroupResizablePrimitive.PanelGroupProps
direction?: "horizontal" | "vertical"
onLayout?: (sizes: number[]) => void
The container for resizable panels that controls orientation.
ResizablePanelResizablePrimitive.PanelProps
defaultSize: number
minSize?: number
maxSize?: number
An individual panel that can be resized.
ResizableHandleResizablePrimitive.PanelResizeHandleProps
withHandle?: boolean
The draggable handle between panels used for resizing.