Draggable splitters for horizontal and vertical panel layouts.
npx shadcn@latest add @preskok/resizableimport {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/components/ui/preskok-ui/resizable"
export function ResizableExample() {
return (
<ResizablePanelGroup
direction="horizontal"
className="min-h-[200px] max-w-md rounded-lg border"
>
<ResizablePanel defaultSize={50} minSize={25}>
<div className="flex h-full items-center justify-center p-4">One</div>
</ResizablePanel>
<ResizableHandle withHandle />
<ResizablePanel defaultSize={50} minSize={25}>
<div className="flex h-full items-center justify-center p-4">Two</div>
</ResizablePanel>
</ResizablePanelGroup>
)
}Panels are powered by react-resizable-panels. Use direction on ResizablePanelGroup, optional withHandle on ResizableHandle for the grip affordance, and defaultSize / minSize on each ResizablePanel as needed.
Horizontal split
Vertical split