Skip to main content

Overview

Sidebar
Main Content
Drag the handle to resize the panels.
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

  • ResizableHandle is keyboard accessible — focus it and use Arrow keys to resize
  • The handle has role="separator" with aria-valuenow, aria-valuemin, aria-valuemax
  • aria-label is 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 minSize to prevent panels from collapsing unexpectedly
  • Use withHandle to make the drag target visually obvious
  • Persist panel sizes to localStorage via onLayout for a better UX
  • Use collapsible for 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 defaultSize values 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