Skip to content
shadcn.io is not affiliated with official shadcn/ui

Shadcn Resizable for React and Tailwind

Divides the interface into resizable sections.

One
Two
Three

Installation

bunx --bun shadcn@latest add https://kit.dev/r/resizable.json

Anatomy

Resizable
├── ResizablePanel
└── ResizableResizeTrigger

Usage

import {
  Resizable,
  ResizablePanel,
  ResizableResizeTrigger,
} from "@/components/ui/resizable";
<Resizable>
  <ResizablePanel id="1" />
  <ResizableResizeTrigger id="1:2" />
  <ResizablePanel id="2" />
</Resizable>

Orientation

Use the orientation prop to control the orientation of the resizable panels.

Horizontal

Set orientation="horizontal" to place panels side by side (default).

Vertical

Set orientation="vertical" to stack panels vertically.

Examples

Handle

Use the withHandle prop on ResizableResizeTrigger to show a visible grip handle for resizing.

Min / Max Size

Use panels with minSize and maxSize to constrain how small or large a panel can be resized.

Multiple Panels

API Reference

Resizable

Root component. Manages resizable panel layout.

PropTypeDefault
panelsPanelData[]-
defaultSizenumber[]-
sizenumber[]-
orientation"horizontal" | "vertical""horizontal"
keyboardResizeBynumber-
onResize(details: ResizeDetails) => void-
onResizeStart() => void-
onResizeEnd(details: ResizeEndDetails) => void-
onCollapse(details: ExpandCollapseDetails) => void-
onExpand(details: ExpandCollapseDetails) => void-
classNamestring-

ResizablePanel

A resizable panel. Multiple panels share the available space.

PropTypeDefault
idstring-
asChildbooleanfalse
classNamestring-

ResizableResizeTrigger

Draggable handle between panels for resizing.

PropTypeDefault
id${string}:${string}-
withHandlebooleanfalse
disabledboolean-
asChildbooleanfalse
classNamestring-

For a complete list of props, see the Ark UI documentation.