Join our Discord Community

Resizable

Accessible resizable panel groups and layouts with keyboard support. Built for React applications with Next.js integration and TypeScript support.

Ever used VS Code or any dev tool where you can drag to resize the sidebar? That's what resizable panels do - they let users adjust the layout to fit their workflow. No more fixed layouts that work for nobody.

Nested resizable panels

Drag the handles to resize panels in any direction:

Loading component...

Built on react-resizable-panels with full keyboard support and proper ARIA attributes. This free open source React component handles all the drag mechanics, constraints, and persistence while you focus on the content.

npx shadcn@latest add resizable

Why resizable panels are game changers

Fixed layouts are nobody's friend. Resizable panels let users work how they want:

  • User-controlled layout - Everyone gets their perfect setup
  • Responsive by default - Panels adapt to available space
  • Keyboard accessible - Arrow keys for fine control
  • Persistence ready - Save layouts to localStorage
  • Smooth dragging - No janky movements or flickering
  • Constraint support - Set min/max sizes that make sense

Useful resizable patterns

Code editor layout

Classic IDE-style layout with file tree and editor:

Loading component...

Dashboard with collapsible sidebar

Sidebar that can collapse to icons or expand for full navigation:

Loading component...

Three column layout

Email client style with list and detail views:

Loading component...

These patterns show up in the best tools because they let users work efficiently. Code editors where you can hide the file tree, dashboards where the sidebar gets out of the way, email clients where you can focus on what matters.

Perfect for productivity apps

Works great anywhere users spend real time - admin panels, dashboards, editors, email clients, data tools. The kind of apps where people have workflows and preferences.

Drops right into Next.js projects. Full TypeScript support. Styled with Tailwind CSS to match the shadcn design system.

Built on react-resizable-panels

Uses bvaughn's react-resizable-panels under the hood, which is battle-tested:

  • Constraint system - Min/max sizes that respect each other
  • Collapse support - Panels can collapse to zero
  • Persistence - Save and restore layouts
  • Keyboard control - Full keyboard navigation
  • Touch support - Works on tablets and touch devices
  • Performance optimized - Smooth even with complex layouts

API Reference

ResizablePanelGroup

Container that manages panel layout and drag state.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
direction"horizontal" | "vertical""horizontal"Panel arrangement direction
autoSaveIdstring-ID for localStorage persistence
storagePanelGroupStorage-Custom storage implementation
onLayout(sizes: number[]) => void-Called when layout changes

ResizablePanel

Individual panel within a group.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
defaultSizenumber-Initial size as percentage
minSizenumber0Minimum size as percentage
maxSizenumber100Maximum size as percentage
collapsiblebooleanfalseCan collapse to zero
collapsedSizenumber0Size when collapsed
onCollapse() => void-Called when panel collapses
onExpand() => void-Called when panel expands

ResizableHandle

Draggable divider between panels.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
withHandlebooleanfalseShow visible drag handle
disabledbooleanfalseDisable dragging

Keyboard Navigation

KeyAction
TabFocus next handle
EnterEnter keyboard resize mode
Arrow Left/UpShrink left/top panel by 10px
Arrow Right/DownGrow left/top panel by 10px
Shift + ArrowsResize by 1px (fine control)
HomeResize to minimum size
EndResize to maximum size
EscapeExit keyboard resize mode

Common Patterns

PatternUse CaseConfiguration
Fixed sidebarNavigation that stays consistentminSize={15} maxSize={15}
Collapsible panelHide when not neededcollapsible={true} collapsedSize={5}
50/50 splitEqual starting pointdefaultSize={50} on both
Golden ratioPleasing proportionsdefaultSize={62} and 38
Persistent layoutRemember user preferenceautoSaveId="my-layout"

Make resizable panels feel right

Keep these in mind when building with resizable panels:

  • Set sensible defaults - Start with a layout that works for most
  • Respect minimums - Don't let panels get too small to be useful
  • Make handles obvious - Users need to know they can drag
  • Consider mobile - Maybe disable resizing on small screens
  • Add collapse buttons - Not everyone finds the drag handles
  • Save user layouts - People hate redoing their setup
  • Test with content - Make sure panels work with real data
  • Provide presets - Quick buttons for common layouts