structyl

Resizable API

View component

The full prop reference for the Resizable component. Resizable panel groups with draggable handles.

Import

tsx
import { Resizable } from '@structyl/styled';

Props

Resizable.Group

Container for resizable panels with drag handles. Manages layout direction and panel size state.

PropTypeDefault
direction#'horizontal' | 'vertical'

Direction of the panel layout (horizontal = left/right, vertical = up/down)

'horizontal'
onLayout#(sizes: number[]) => void

Callback fired when panel sizes change, receives array of all panel sizes in order

asChild#boolean

If true, renders the primitive's child element instead of a div wrapper (Radix-style asChild)

className#string

CSS 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.

PropTypeDefault
id#string

Required unique identifier for the panel, used in Handle 'between' prop

defaultSize#number

Initial flex size (0-100, treated as flex units); controls initial width/height ratio

50
minSize#number

Minimum allowed size; prevents resizing below this flex unit value

10
maxSize#number

Maximum allowed size; prevents resizing above this flex unit value

90
asChild#boolean

If true, renders the primitive's child element instead of a div wrapper

className#string

CSS 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.

PropTypeDefault
between#[string, string]

Required tuple of two panel IDs on each side of the handle; controls which panels resize together

withHandle#boolean

Styled version only: if true, renders a visual grip icon inside the handle

asChild#boolean

If true, renders the primitive's child element instead of a div wrapper

className#string

CSS 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 .

structyl — Accessible React Component Library