mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-29 15:44:22 +00:00
- 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
27 lines
772 B
TypeScript
27 lines
772 B
TypeScript
import {
|
|
ResizableHandle,
|
|
ResizablePanel,
|
|
ResizablePanelGroup,
|
|
} from "@/examples/base/ui/resizable"
|
|
|
|
export default function ResizableHandleDemo() {
|
|
return (
|
|
<ResizablePanelGroup
|
|
orientation="horizontal"
|
|
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">Sidebar</span>
|
|
</div>
|
|
</ResizablePanel>
|
|
<ResizableHandle withHandle />
|
|
<ResizablePanel defaultSize="75%">
|
|
<div className="flex h-full items-center justify-center p-6">
|
|
<span className="font-semibold">Content</span>
|
|
</div>
|
|
</ResizablePanel>
|
|
</ResizablePanelGroup>
|
|
)
|
|
}
|