Resizable

Accessible resizable panel groups and layouts, built on react-resizable-panels.

Last updated January 1, 1980

CreditsUnchangedPublished

Copied from shadcn/ui.

Overview

Installation

Usage

import {
 
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup,
} from "@/components/ui/resizable"
 
export function Example() {
  return (
    <ResizablePanelGroup direction="horizontal" className="h-40">
      <ResizablePanel defaultSize={50}>Sidebar</ResizablePanel>
      <ResizableHandle withHandle />
      <ResizablePanel defaultSize={50}>Content</ResizablePanel>
    </ResizablePanelGroup>
  )
}

Examples

Vertical

RTL

The drag handle's centering is direction-agnostic, and the panel order visually flips along with the surrounding layout under RTL.

API Reference

ResizablePanelGroup

ResizablePanel

ResizableHandle