Overview
Resizable provides a split-pane layout where the user can drag a handle to resize adjacent panels. Supports horizontal and vertical splits, with configurable min/max sizes and collapsible panels.
Installation
Usage
Variants
Horizontal Split (Sidebar + Main)
Vertical Split (Editor + Preview)
Three-Panel Layout
API Reference
ResizablePanelGroup
string
required
Split direction. Values:
horizontal · vertical(sizes: number[]) => void
Callback fired when panel sizes change. Receives an array of percentage sizes.
string
Additional class names. Set
min-h-* or h-* here to constrain the group height.ResizablePanel
number
Initial size as a percentage of the group (0–100).
number
Minimum size as a percentage.
number
Maximum size as a percentage.
boolean
default:"false"
Allows the panel to collapse to zero when dragged past its minimum size.
number
default:"0"
Size in percentage when collapsed.
ResizableHandle
boolean
default:"false"
Shows a visible grip icon on the divider for discoverability.
Accessibility
ResizableHandleis keyboard accessible — focus it and use Arrow keys to resize- The handle has
role="separator"witharia-valuenow,aria-valuemin,aria-valuemax aria-labelis automatically set based on the adjacent panel names- On touch devices, the handle responds to touch drag events
Do’s & Don’ts
Do
- Always set
minSizeto prevent panels from collapsing unexpectedly - Use
withHandleto make the drag target visually obvious - Persist panel sizes to
localStorageviaonLayoutfor a better UX - Use
collapsiblefor sidebar panels that users may want to hide entirely
Don't
- Don’t use Resizable on mobile — touch drag on small screens is error-prone
- Don’t set
defaultSizevalues that don’t add up to 100 - Don’t put critical content in a panel that can collapse to zero without warning
- Don’t nest ResizablePanelGroups unless necessary — it complicates layout logic