Resizable Panel
Resizable panel layouts with drag handles. Create split panes for editors, file browsers, and dashboards.
Preview
Import
import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@sigil-ui/components";Usage
<ResizablePanelGroup orientation="horizontal" className="min-h-[120px] border border-[var(--s-border)]">
<ResizablePanel>Left</ResizablePanel>
<ResizableHandle />
<ResizablePanel>Right</ResizablePanel>
</ResizablePanelGroup>Vertical split
<ResizablePanelGroup orientation="vertical" className="h-[400px]">
<ResizablePanel defaultSize="60%">
<div className="p-4">Editor</div>
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize="40%">
<div className="p-4">Terminal</div>
</ResizablePanel>
</ResizablePanelGroup>Three-panel layout
<ResizablePanelGroup orientation="horizontal">
<ResizablePanel defaultSize="20%" minSize="15%">Sidebar</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize="50%">Editor</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize="30%" minSize="20%">Preview</ResizablePanel>
</ResizablePanelGroup>Token integration
| CSS Variable | Used for |
|---|---|
--s-border | Handle color |
--s-border-interactive | Handle hover/active color |
--s-surface | Panel background |
--s-duration-fast | Handle hover transition |
Props
ResizablePanelGroup
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | Split direction |
className | string | — | Additional CSS classes |
children | ReactNode | — | Panels and handles |
ResizablePanel
| Prop | Type | Default | Description |
|---|---|---|---|
defaultSize | number | — | Initial size as percentage |
minSize | number | 10 | Minimum size as percentage |
maxSize | number | — | Maximum size as percentage |
className | string | — | Additional CSS classes |
children | ReactNode | — | Panel content |
Accessibility
- Handle is focusable with
role="separator"andaria-orientation - Arrow keys resize panels by 10% increments
aria-valuemin,aria-valuemax,aria-valuenowreflect panel size