Radio GroupScroll Area
Get Started
Introduction
Components
Accordion
Badge
Button
Card
Checkbox
Command
Dialog
Dropdown Menu
Input
Select
Switch
Table
Tabs
Toast
Tooltip
Forms
Controlled Input
Field Arrays
Submit
Validation

Accessible resizable panel groups and layouts with drag and keyboard support.

One
Two

#Installation

bunx --bun barefoot add resizable

#Usage

One
Two
1"use client"23import {4  ResizablePanelGroup,5  ResizablePanel,6  ResizableHandle,7} from "@/components/ui/resizable"89function ResizableDemo() {10  return (11    <ResizablePanelGroup direction="horizontal" class="min-h-[200px] rounded-lg border">12      <ResizablePanel defaultSize={20} minSize={15} maxSize={40}>13        <div className="flex h-full items-center justify-center p-6">14          <span className="font-semibold">Sidebar</span>15        </div>16      </ResizablePanel>17      <ResizableHandle withHandle />18      <ResizablePanel defaultSize={55} minSize={30}>19        <div className="flex h-full items-center justify-center p-6">20          <span className="font-semibold">Content</span>21        </div>22      </ResizablePanel>23      <ResizableHandle withHandle />24      <ResizablePanel defaultSize={25} minSize={15} maxSize={35}>25        <div className="flex h-full items-center justify-center p-6">26          <span className="font-semibold">Aside</span>27        </div>28      </ResizablePanel>29    </ResizablePanelGroup>30  )31}

#Examples

#Horizontal

One
Two
1"use client"23import {4  ResizablePanelGroup,5  ResizablePanel,6  ResizableHandle,7} from "@/components/ui/resizable"89function ResizableHorizontal() {10  return (11    <ResizablePanelGroup direction="horizontal" class="max-w-md rounded-lg border">12      <ResizablePanel defaultSize={50}>13        <div className="flex h-[200px] items-center justify-center p-6">14          <span className="font-semibold">One</span>15        </div>16      </ResizablePanel>17      <ResizableHandle />18      <ResizablePanel defaultSize={50}>19        <div className="flex h-[200px] items-center justify-center p-6">20          <span className="font-semibold">Two</span>21        </div>22      </ResizablePanel>23    </ResizablePanelGroup>24  )25}

#Vertical

Header
Content
1"use client"23import {4  ResizablePanelGroup,5  ResizablePanel,6  ResizableHandle,7} from "@/components/ui/resizable"89function ResizableVertical() {10  return (11    <ResizablePanelGroup direction="vertical" class="min-h-[200px] max-w-md rounded-lg border">12      <ResizablePanel defaultSize={25}>13        <div className="flex h-full items-center justify-center p-6">14          <span className="font-semibold">Header</span>15        </div>16      </ResizablePanel>17      <ResizableHandle />18      <ResizablePanel defaultSize={75}>19        <div className="flex h-full items-center justify-center p-6">20          <span className="font-semibold">Content</span>21        </div>22      </ResizablePanel>23    </ResizablePanelGroup>24  )25}

#With Handle

Sidebar
Content
1"use client"23import {4  ResizablePanelGroup,5  ResizablePanel,6  ResizableHandle,7} from "@/components/ui/resizable"89function ResizableWithHandle() {10  return (11    <ResizablePanelGroup direction="horizontal" class="min-h-[200px] max-w-md rounded-lg border">12      <ResizablePanel defaultSize={25}>13        <div className="flex h-full items-center justify-center p-6">14          <span className="font-semibold">Sidebar</span>15        </div>16      </ResizablePanel>17      <ResizableHandle withHandle />18      <ResizablePanel defaultSize={75}>19        <div className="flex h-full items-center justify-center p-6">20          <span className="font-semibold">Content</span>21        </div>22      </ResizablePanel>23    </ResizablePanelGroup>24  )25}

#Three Panels

Sidebar
Content
Aside
1"use client"23import {4  ResizablePanelGroup,5  ResizablePanel,6  ResizableHandle,7} from "@/components/ui/resizable"89function ResizableThreePanels() {10  return (11    <ResizablePanelGroup direction="horizontal" class="min-h-[200px] rounded-lg border">12      <ResizablePanel defaultSize={20} minSize={15} maxSize={40}>13        <div className="flex h-full items-center justify-center p-6">14          <span className="font-semibold">Sidebar</span>15        </div>16      </ResizablePanel>17      <ResizableHandle withHandle />18      <ResizablePanel defaultSize={55} minSize={30}>19        <div className="flex h-full items-center justify-center p-6">20          <span className="font-semibold">Content</span>21        </div>22      </ResizablePanel>23      <ResizableHandle withHandle />24      <ResizablePanel defaultSize={25} minSize={15} maxSize={35}>25        <div className="flex h-full items-center justify-center p-6">26          <span className="font-semibold">Aside</span>27        </div>28      </ResizablePanel>29    </ResizablePanelGroup>30  )31}

#API Reference

ResizablePanelGroup

PropTypeDefaultDescription
direction'horizontal' | 'vertical'-The layout direction of panels.
classstring''Additional CSS classes.
onLayout(sizes: number[]) => void-Callback fired when panel sizes change.

ResizablePanel

PropTypeDefaultDescription
defaultSizenumber-Initial size as percentage (0-100).
minSizenumber0Minimum size as percentage.
maxSizenumber100Maximum size as percentage.
classstring''Additional CSS classes.

ResizableHandle

PropTypeDefaultDescription
withHandlebooleanfalseShow visible grip dots on the handle.
disabledbooleanfalseDisable drag interaction.
classstring''Additional CSS classes.