Resize Box
Layout helpersMITDrag-handle resizable panel container — for split panes and adjustable sidebars.
bun add @otfdashkit/ui
Preview
Resize BoxLayout helpers
Code
@otfdashkit/uiimport { ResizeBox, ResizeHandle } from '@otfdashkit/ui/layouts-resize-box'
export function Example() {
return (
<div className="p-4">
<p className="text-xs text-[hsl(var(--muted-foreground))] mb-3 font-medium uppercase tracking-wider">Drag the handle to resize</p>
<ResizeBox
resize="both"
minWidth={200}
minHeight={120}
className="border border-[hsl(var(--border))] rounded-lg bg-[hsl(var(--card))] p-4"
style={{ width: 320, height: 180 }}
>
<p className="text-sm text-[hsl(var(--muted-foreground))]">This box is resizable. Drag the bottom-right corner to resize it.</p>
<ResizeHandle />
</ResizeBox>
</div>
)
}
Free with the SDK. This block ships in @otfdashkit/ui under the MIT license.
Props
Props declared in the ResizeBox source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| minHeight | number | 100 | |
| minWidth | number | 100 | |
| resize | 'horizontal' | 'vertical' | 'both' | 'none' | 'both' |