Layout

ResizeHandle

A draggable divider that resizes the panel beside it — a pixel size over `v-model`, clamped between `min` and `max`, on either axis. Pointer travel past a bound is reported through `overdrag` rather than swallowed, which is how a parent turns a hard drag into a collapse. Also keyboard-operable, and double-clickable to reset.

vue
<UiResizeHandle />

Options

One block per prop — what it does, and what it looks like set.

Model value

modelValue is the pixel size the handle is currently resizing, bound two-way with v-model. The handle owns none of it — it reads the number, adds the pointer's travel, and hands the new one back, so the width below is your state and the panel is sized off it however you like.

Panel — 200px
Drag the divider

Direction

direction is the axis the handle drags along, and it's the only thing that decides the handle's own shape: horizontal is the vertical bar between two columns, vertical the horizontal one between two rows. It also picks which arrow keys move the value.

Row — 100px
Drag the divider up and down

Min

min is how small dragging can make the panel. The handle stops emitting there rather than clamping after the fact, so the panel never flickers past its floor — and the pointer travel beyond it is still reported through overdrag if you want to act on it.

Stops at 160px
220px

The handle never writes a value outside min/max, so "dragged too far" can only be learned from overdrag, which reports the leftover pointer travel in pixels — negative past min, positive past max. Pin the handle (min === max) and the entire drag arrives there instead, which is how a collapsed panel knows when to come back.

Max

max is the other bound. It defaults to Infinity, which is fine for a panel whose container already limits it — but a handle with no ceiling will happily drag a panel past the edge of its parent, so set one whenever the layout doesn't.

Stops at 260px
180px

If the parent changes modelValue mid-drag — snapping a panel to a collapsed width, say — the handle re-anchors to wherever the pointer currently is instead of continuing from the value it was measuring against. Without that, the next pointer move would yank the panel straight back to where it was.

Step

step is the keyboard's grain. Tab to the handle below — it's a focusable separator, not decoration — and the arrow keys move the panel by this much, shift-arrow by ten times it, with Home and End jumping to the bounds.

Tab here, then press ← →
200px — 20px a press

Invert

invert flips which way is bigger. A panel anchored to the right edge grows as the pointer moves left, which is the opposite of what the raw pointer delta says — set this and the handle does that subtraction for you rather than you mirroring the math at the call site.

Content
Right panel — 200px

Variant

variant is what's drawn inside the hit area. The default grip is a short pill that's always on show, so the seam reads as draggable before anyone hovers it. line is a full-length rule that only appears on hover, for a seam the panels already imply; hidden draws nothing.

grip
line
hidden

Size

size widens the hit area without touching the indicator inside it. It's a pointer-accuracy setting rather than a visual one: the same 2px line, with 8, 12 or 16 pixels of room around it to grab.

sm
md
lg

Reset value

resetValue is the width a double-click puts back. Set it to whatever the panel opened at and the reader always has a way out of a layout they've dragged into a corner — leave it unset and double-clicking does nothing at all.

Drag me, then double-click the divider
220px — resets to 220

Label

label is the accessible name on the separator, which is all a screen reader has to go on — the handle has no text of its own. The default, "Resize", is enough on a page with one; name them for what they move as soon as there are two.

Files
The handle announces as "Resize file tree"

Disabled

disabled freezes the panel at its current size — the handle stops responding to the pointer and the keyboard, and drops out of the tab order.

Fixed at 180px
Nothing happens on drag

Examples

The component in real use: compositions that answer "how do I build X with this", rather than one prop at a time.

Drag past the minimum to collapse — what `overdrag` is for

The handle never emits a value outside its bounds, so a panel that should *do* something when dragged too far can't learn it from update:modelValue. overdrag reports that leftover travel in pixels — negative past min, positive past max — and the parent decides what it means. This is exactly how Sidebar collapses.

Explorer
Drag left past 140px to collapse

A three-pane layout — one handle per seam, each owning its own width

Nav
Editor
Inspector

API Reference

Generated from the component's source — props, slots and emits as the component actually declares them.

Props

Prop
Type
Default
Description
number
0
The size, in pixels, the handle is currently resizing — a width when `direction` is `horizontal`, a height when it's `vertical`. Bind it with `v-model`.
"horizontal" | "vertical"
'horizontal'
The axis the handle drags along. `horizontal` is a vertical bar dragged left and right to resize a column; `vertical` is a horizontal bar dragged up and down to resize a row.
number
0
The smallest value dragging can reach. Pointer movement past it is reported through `overdrag` rather than shrinking the value any further.
number
Infinity
The largest value dragging can reach. Pointer movement past it is reported through `overdrag` rather than growing the value any further.
number
10
How far one arrow-key press moves the value. Holding shift multiplies it by ten.
boolean
false
Flips which pointer direction grows the value — for a panel anchored to the right or bottom edge, where dragging back toward the middle of the screen is what makes it bigger.
"line" | "grip" | "hidden"
'grip'
The visual drawn inside the hit area. `grip` is a short centered pill, always visible; `line` is a full-length rule that only appears on hover; `hidden` leaves the hit area invisible.
"sm" | "md" | "lg"
'md'
The thickness of the hit area — 8, 12 or 16 pixels across. The indicator inside keeps its own width either way; this is how much room the pointer has to find it.
number
—
The value a double-click restores. Leave it unset and double-clicking does nothing.
string
'Resize'
The accessible name announced for the handle.
boolean
false
Disables dragging and keyboard resizing.

Slots

Slot
default
Receives `{ dragging, value }`.

Emits

Event
Payload
Description
update:modelValue
[value: number]
—
resize-start
[value: number]
Fired on pointer-down, with the value the drag starts from.
resize-end
[value: number]
Fired on pointer-up, with the value the drag settled on.
overdrag
[amount: number]
How far, in pixels, the pointer has been dragged past `min` (negative) or `max` (positive). Fired on every move while out of bounds, and it's how a parent implements "drag past the minimum to collapse" — the handle itself only ever emits values inside the bounds.