Resizable
Resizable splits an area into panels that users resize by dragging or with the keyboard. Use it for layouts like a sidebar beside an editor. Give every ResizableHandle an aria-label.
Installation
Run npx nxds-cli@latest init first if nxds isn’t set up in your app yet. See Install.
Usage
Composition
Examples
Vertical
Stack panels vertically, with a horizontal divider between them.
Three panels
Split the area into three panels with two handles.
Props
ResizableHandle
| Prop | Type | Default | Description |
|---|---|---|---|
withHandle | boolean | No default documented | Shows a grip in the centre of the handle. |
ResizablePanel
| Prop | Type | Default | Description |
|---|---|---|---|
collapsedSize | number | No default documented | Size when collapsed, in |
defaultSize | number | No default documented | Starting size, in |
maxSize | number | No default documented | Largest size, in |
minSize | number | 0 | Smallest size, in |
sizeUnit | "px" | "%" | "%" | Unit for every size prop: a percentage of the group, or pixels. |
ResizablePanelGroup
| Prop | Type | Default | Description |
|---|---|---|---|
onLayoutChange | ((layout: number[]) => void) | No default documented | Called with each panel's size, as a percentage, while the layout changes. |
orientation | "horizontal" | "vertical" | "horizontal" | The axis the panels split along. |
Resizable splits an area into panels that users resize by dragging or with the keyboard. Use it for layouts like a sidebar beside an editor. Give every ResizableHandle an aria-label.
Installation
Install the following dependencies:
Copy and paste the following code into your project.
components/resizable/ResizableHandle.vue components/resizable/ResizablePanel.vue components/resizable/ResizablePanelGroup.vue components/resizable/index.ts lib/icons.ts Keep each file at the path shown above it.
Paths are relative to
packages/vue/src/. Keep the same folders under your@/root, and the imports between files work without edits.
Usage
Examples
Vertical
Stack panels vertically, with a horizontal divider between them.
Three panels
Split the area into three panels with two handles.
Props
ResizableHandle
| Prop | Type | Default | Description |
|---|---|---|---|
withHandle | boolean | No default documented | Shows a grip in the centre of the handle. |
ResizablePanel
| Prop | Type | Default | Description |
|---|---|---|---|
collapsedSize | number | No default documented | Size when collapsed, in |
defaultSize | number | No default documented | Starting size, in |
maxSize | number | No default documented | Largest size, in |
minSize | number | 0 | Smallest size, in |
sizeUnit | "%" | "px" | "%" | Unit for every size prop: a percentage of the group, or pixels. |
ResizablePanelGroup
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "vertical" | "horizontal" | "horizontal" | The axis the panels split along. |