Dots

Resizable

Accessible resizable panel groups and layouts with keyboard support.

One
Two
Three
import {
  ResizableHandle,
  ResizablePanel,

About

The Resizable component is built on top of react-resizable-panels by bvaughn.

Installation

pnpm dlx shadcn@latest add @dots/resizable

Usage

import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup,
} from "@/components/ui/resizable"
<ResizablePanelGroup orientation="horizontal">
  <ResizablePanel>One</ResizablePanel>
  <ResizableHandle />
  <ResizablePanel>Two</ResizablePanel>
</ResizablePanelGroup>

Composition

Use the following composition to build a ResizablePanelGroup:

ResizablePanelGroup
├── ResizablePanel
├── ResizableHandle
└── ResizablePanel

Vertical

Use orientation="vertical" for vertical resizing.

Header
Content
import {
  ResizableHandle,
  ResizablePanel,

Handle

Use the withHandle prop on ResizableHandle to show a visible handle.

Sidebar
Content
import {
  ResizableHandle,
  ResizablePanel,

API Reference

See the react-resizable-panels documentation.