Skip to content
shadcn.io

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
    └── ResizableResizeTriggerIndicator

Usage

import {
  Resizable,
  ResizablePanel,
  ResizableResizeTrigger,
} from "@/components/ui/resizable";
<Resizable
  className="rounded-md border"
  defaultSize={[50, 50]}
  panels={[
    { id: "1", minSize: 10 },
    { id: "2", minSize: 10 },
  ]}
>
  <ResizablePanel className="flex h-full items-center justify-center" id="1">
    One
  </ResizablePanel>

  <ResizableResizeTrigger id="1:2" />

  <ResizablePanel id="2">
    <Resizable
      defaultSize={[50, 50]}
      orientation="vertical"
      panels={[
        { id: "3", minSize: 10 },
        { id: "4", minSize: 10 },
      ]}
    >
      <ResizablePanel className="flex items-center justify-center" id="3">
        Two
      </ResizablePanel>

      <ResizableResizeTrigger id="3:4" />

      <ResizablePanel className="flex items-center justify-center" id="4">
        Three
      </ResizablePanel>
    </Resizable>
  </ResizablePanel>
</Resizable>

Accessibility

KeyDescription
Enter
Activate the focused item.
ArrowUp
Move up.
ArrowDown
Move down.
ArrowLeft
Move left.
ArrowRight
Move right.
Home
Go to the start.
End
Go to the end.
F6
Handle the F6 key.

Demos

Handle

Min Max

Multiple Panels

Orientation Horizontal

Orientation Vertical

API Reference

Resizable

div

PropType
AttributeType

ResizablePanel

div

PropType
AttributeType

ResizableResizeTrigger

button

PropType
AttributeType

useResizable