useXDSResizable@xds/core · Resizable
Preview coming soon

Usage

Hook for adding drag-to-resize behavior to layout regions. Supports single-region and multi-region configurations with snap points, collapsible panels, localStorage persistence, and cascade resize ordering.

Best practices

GuidancePractices
DoUse with XDSLayout or XDSAppShell sidebar for resizable navigation panels.
DoSet autoSaveId to persist user-chosen sizes across page reloads.
Don'tSet minSizePx too small — content becomes unreadable. Prefer collapsible for panels that can hide entirely.

Parameters

ParamTypeDescription
defaultSize
number | stringInitial size in pixels or percentage string (e.g. "20%").
minSizePx
number (default: 50)Minimum size in pixels.
maxSizePx
number (default: Infinity)Maximum size in pixels.
collapsible
boolean (default: false)Whether dragging below the collapsed threshold collapses the region to zero.
snaps
number[]Pixel values to snap to during drag.
autoSaveId
stringKey for localStorage persistence of size across sessions.

Returns

FieldTypeDescription
sizenumberCurrent size in pixels.
isCollapsedbooleanWhether the region is currently collapsed.
collapse() => voidProgrammatically collapse the region.
expand() => voidExpand from collapsed state.
resize(size: number) => voidResize to a specific pixel value.
propsResizablePropsProps to spread on the resizable component or pass to XDSResizeHandle.

Import

ts
import {useXDSResizable} from '@xds/core/Resizable'