No results found

Resizable

A draggable divider that allows users to adjust the size of adjacent sections.

Left Panel (min: 100, max: 500)
Right Panel (min: 150)

When to use Resizable

Resizable is ideal when:

Real-world examples:

Features

  • WAI ARIA Separator pattern implementation
  • Keyboard navigation with arrow keys and Home/End
  • Collapsible panels with custom thresholds
  • Responsive resizing with min/max constraints
  • Panel size synchronization across handles
  • Dynamic orientation (horizontal/vertical)
  • Fine-grained resizing control with Shift key
  • Progressive size adjustments with step values
  • Custom collapse/expand behaviors with callbacks
  • Flexible initial sizing with auto-distribution
  • Accessible resize handles with ARIA attributes

Anatomy

PartDescription
<Resizable.Root>Container component that manages the resizable layout and state
<Resizable.Panel>Individual panel component that can be resized
<Resizable.Handle>Interactive handle component for resizing adjacent panels

Examples

Basic Usage

Start with this example if you're new to Resizable. It shows the minimal setup needed for a functional component.

Left Panel (min: 100, max: 500)
Right Panel (min: 150)

This example demonstrates:

<Resizable.Root>
  <Resizable.Panel width={200} minWidth={100} maxWidth={500}>
    <div>Left Panel</div>
  </Resizable.Panel>
  <Resizable.Handle />
  <Resizable.Panel minWidth={150}>
    <div>Right Panel</div>
  </Resizable.Panel>
</Resizable.Root>

Vertical Layout

Change the resize direction to vertical for stacked layouts.

Header
Main Content
Footer

Collapsible Panels

Enable panel collapsing with customizable thresholds and sizes.

Collapsible Panel (min: 150, collapsed: 50)
Regular Panel (min: 200)

This demonstrates:

Nested Layouts

Create complex layouts by nesting resizable components.

Left Panel
Top Panel
Bottom Panel

State Management

Track and respond to panel size changes.

Left Panel (min: 100, max: 500)
Right Panel (min: 150)

Disabled State

Prevent resizing when needed.

Left Panel (min: 100, max: 500)
Right Panel (min: 150)

Keyboard Navigation

The component supports full keyboard interaction:

Accessibility

Built following the WAI-ARIA window splitter pattern, including:

Styling

The component uses data attributes for styling:

[data-qds-resizable-root] {
  /* Root styles */
}

[data-qds-resizable-handle][data-dragging="true"] {
/* Handle drag state */
}

[data-qds-resizable-panel][data-collapsed="true"] {
/* Collapsed panel state */
}

API Reference

Resizable Panel

Inherits from: <div />

Props

PropTypeDefaultDescription
widthnumber-
heightnumber-
minWidthnumber-
maxWidthnumber-
minHeightnumber-
maxHeightnumber-
collapsibleboolean-
collapsedboolean-
collapsedSizenumber-
collapseThresholdnumber-
onResize$QRL<(size: number) => void>-
onCollapse$QRL<() => void>-
onExpand$QRL<() => void>-

Data Attributes

AttributeDescription
data-orientationThe orientation of the panel
data-min-sizeMinimum size constraint for the panel
data-max-sizeMaximum size constraint for the panel
data-collapsibleIndicates whether the panel is collapsible
data-collapsed-sizeSize when panel is collapsed
data-collapse-thresholdThreshold for triggering collapse
data-is-collapsedCurrent collapsed state of the panel

Resizable Root

Inherits from: <div />

Props

PropTypeDefaultDescription
orientation"horizontal" | "vertical"-
disabledboolean-
storageKeystring-

Data Attributes

AttributeDescription
data-orientationThe orientation of the resizable container
data-disabledIndicates whether resizing is disabled

Resizable Handle

Inherits from: <button />

Data Attributes

AttributeDescription
data-orientationThe orientation of the handle
data-draggingIndicates whether the handle is being dragged
data-disabledIndicates whether the handle is disabled