"use client";
import { ResizeHandle } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
onStep | (delta: number) => void | — | Arrow keys: delta is ±step; positive grows the panel before the handle (ArrowRight in LTR, ArrowLeft in RTL, ArrowDown when vertical). |
label | string | — | Visible label (also the accessible name). |
onDragTo | (fraction: number) => void | — | Pointer drag: fraction (0–1) is the pointer position along the parent group's main axis, measured from its inline start (top when vertical), RTL aware. |
onEdge | (edge: "min" | "max") => void | — | Home / End: move to the smallest / largest size. |
onToggle | () => void | — | Enter: collapse the panel before the handle, or restore it. |
orientation | "horizontal" | "vertical" | — | Layout of the panel group: horizontal = side by side (a vertical bar). |
step | number | — | — |
onStep(delta: number) => void
Arrow keys: delta is ±step; positive grows the panel before the handle (ArrowRight in LTR, ArrowLeft in RTL, ArrowDown when vertical).
labelstring
Visible label (also the accessible name).
onDragTo(fraction: number) => void
Pointer drag: fraction (0–1) is the pointer position along the parent group's main axis, measured from its inline start (top when vertical), RTL aware.
onEdge(edge: "min" | "max") => void
Home / End: move to the smallest / largest size.
onToggle() => void
Enter: collapse the panel before the handle, or restore it.
orientation"horizontal" | "vertical"
Layout of the panel group: horizontal = side by side (a vertical bar).
stepnumber
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const [width, setWidth] = useState(50);
<ResizeHandle aria-valuenow={width} aria-valuemin={0} aria-valuemax={100} onStep={(delta) => setWidth((value) => Math.min(100, Math.max(0, value + delta)))} />