Resizable
Keyboard and pointer resizable panel composition.
Keyboard and pointer resizable panel composition.
Import
Section titled “Import”import { Resizable } from "@zentara-co/zenos-ui";Orientation
Section titled “Orientation”Horizontal roots place panels side by side and expose a vertical separator. Vertical roots stack panels and expose a horizontal separator.
The default handle keeps an 8px interaction target around a centered 1px separator. Its line uses the focused border color on hover, while pressed, and during keyboard focus, making the resize affordance visible without widening the panel gap.
Controlled sizes
Section titled “Controlled sizes”Panel values are percentages and are normalized to total 100. In controlled mode, update value from onValueChange to reflect pointer and keyboard requests.
Editor 40% · Preview 60%
Panel constraints
Section titled “Panel constraints”minSize and maxSize constrain adjacent panel percentages. Every handle resizes the panel immediately before and after it.
Disabled
Section titled “Disabled”A disabled root prevents pointer and keyboard resizing and removes its handles from the tab order.
Variants
orientation: horizontalorientation: vertical Resizable.Root Resizable.Panel Resizable.Handle
API
| Prop | Type | Default | Description |
|---|---|---|---|
value | number[] | — | Controlled panel percentages. |
defaultValue | number[] | — | Initial panel percentages. |
onValueChange | (sizes: number[]) => void | — | Runs while panels resize. |
orientation | horizontal | vertical | horizontal | Panel flow direction. |
keyboardStep | number | 5 | Percentage changed by arrow keys. |
disabled | boolean | false | Disables resize interaction. |
Panel.defaultSize | number | — | Initial percentage when Root.defaultValue is omitted. |
Panel.minSize / maxSize | number | 0 / 100 | Constrains the panel percentage during resizing. |
Handle.children | ReactNode | — | Optional visual rendered at the separator center. |
native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Each handle is a focusable separator with orientation and current, minimum, and maximum percentage values. Give every handle a label that identifies the adjacent panels. Left and Right Arrow resize horizontal panels; Up and Down Arrow resize vertical panels. Home and End move to the permitted minimum and maximum. Visible focus remains on the handle throughout keyboard resizing.