Resizable
shadcn/uiAccessible resizable panel groups and layouts with keyboard support.
Resizable
One
Two
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/optics/resizable";<ResizablePanelGroup className="max-w-md rounded-lg border bg-background" direction="horizontal"> <ResizablePanel defaultSize={50}> <div className="flex h-[200px] items-center justify-center p-6"> <span className="font-semibold"> One </span> </div> </ResizablePanel> <ResizableHandle withHandle /> <ResizablePanel defaultSize={50}> <div className="flex h-[200px] items-center justify-center p-6"> <span className="font-semibold"> Two </span> </div> </ResizablePanel></ResizablePanelGroup>import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/optics/resizable";<ResizablePanelGroup className="max-w-md rounded-lg border bg-background" direction="horizontal"> <ResizablePanel defaultSize={50}> <div className="flex h-[200px] items-center justify-center p-6"> <span className="font-semibold"> One </span> </div> </ResizablePanel> <ResizableHandle withHandle /> <ResizablePanel defaultSize={50}> <div className="flex h-[200px] items-center justify-center p-6"> <span className="font-semibold"> Two </span> </div> </ResizablePanel></ResizablePanelGroup>Installation
pnpm dlx shadcn@latest add @optics/resizable
Props
<ResizableHandle />
Name | Type | |
|---|---|---|
withHandle | boolean(default: false) |