Files
shadcn-ui/apps/v4/examples/base/resizable-vertical.tsx
Jaem dfe784b44a fix(resizable): upgrade to react-resizable-panels v4
- Update component API: PanelGroup → Group, PanelResizeHandle → Separator
- Update prop: direction → orientation
- Update size values: number → string with units (e.g., "50%")
- Update CSS selectors: data-[panel-group-direction] → aria-[orientation]
- Update controlled component: onLayout → onLayoutChange with Layout type

Closes #9118, #9136, #9200
2026-01-27 03:10:54 +09:00

27 lines
748 B
TypeScript

import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/examples/base/ui/resizable"
export function ResizableVertical() {
return (
<ResizablePanelGroup
orientation="vertical"
className="min-h-[200px] max-w-sm rounded-lg border"
>
<ResizablePanel defaultSize="25%">
<div className="flex h-full items-center justify-center p-6">
<span className="font-semibold">Header</span>
</div>
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize="75%">
<div className="flex h-full items-center justify-center p-6">
<span className="font-semibold">Content</span>
</div>
</ResizablePanel>
</ResizablePanelGroup>
)
}