Resizable API
View componentThe full prop reference for the Resizable component. Resizable panel groups with draggable handles.
Import
import { Resizable } from '@structyl/styled';Props
Resizable.Group
Container for resizable panels with drag handles. Manages layout direction and panel size state.
| Prop | Type | Default |
|---|---|---|
| direction# | 'horizontal' | 'vertical'Direction of the panel layout (horizontal = left/right, vertical = up/down) | 'horizontal' |
| onLayout# | (sizes: number[]) => voidCallback fired when panel sizes change, receives array of all panel sizes in order | — |
| asChild# | booleanIf true, renders the primitive's child element instead of a div wrapper (Radix-style asChild) | — |
| className# | stringCSS class names; styled version defaults to 'flex h-full w-full' plus custom classes | — |
| ref# | React.Ref<HTMLDivElement>Forward ref to the underlying div element | — |
| ...htmlAttributes# | React.ComponentPropsWithoutRef<'div'>All standard HTML div attributes (style, id, data-*, event handlers, etc.) | — |
Resizable.Panel
Individual resizable panel within a Group. Expands/contracts based on handle drag interactions.
| Prop | Type | Default |
|---|---|---|
| id# | stringRequired unique identifier for the panel, used in Handle 'between' prop | — |
| defaultSize# | numberInitial flex size (0-100, treated as flex units); controls initial width/height ratio | 50 |
| minSize# | numberMinimum allowed size; prevents resizing below this flex unit value | 10 |
| maxSize# | numberMaximum allowed size; prevents resizing above this flex unit value | 90 |
| asChild# | booleanIf true, renders the primitive's child element instead of a div wrapper | — |
| className# | stringCSS class names for custom styling | — |
| ref# | React.Ref<HTMLDivElement>Forward ref to the underlying div element | — |
| ...htmlAttributes# | React.ComponentPropsWithoutRef<'div'>All standard HTML div attributes; note tabIndex defaults to 0 for keyboard accessibility | — |
Resizable.Handle
Draggable resize handle positioned between two panels. Emits size changes as user drags.
| Prop | Type | Default |
|---|---|---|
| between# | [string, string]Required tuple of two panel IDs on each side of the handle; controls which panels resize together | — |
| withHandle# | booleanStyled version only: if true, renders a visual grip icon inside the handle | — |
| asChild# | booleanIf true, renders the primitive's child element instead of a div wrapper | — |
| className# | stringCSS class names; styled version defaults to flex styling with border and focus ring | — |
| ref# | React.Ref<HTMLDivElement>Forward ref to the underlying div element | — |
| ...htmlAttributes# | React.ComponentPropsWithoutRef<'div'>All standard HTML div attributes; handle has role='separator', aria-orientation set automatically, tabIndex defaults to 0 | — |
Source code
If you didn't find what you need here, read the component implementation .