Component docs
Loading
"use client";
import { ZoomControls } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
onZoomIn (required) | () => void | — | — |
onZoomOut (required) | () => void | — | — |
value (required) | number | — | Current value (controlled); null where it means "nothing selected". |
max | number | — | — |
min | number | — | — |
onReset | () => void | — | — |
resetLabel | string | — | — |
zoomInLabel | string | — | — |
zoomOutLabel | string | — | — |
onZoomInrequired() => void
onZoomOutrequired() => void
valuerequirednumber
Current value (controlled); null where it means "nothing selected".
maxnumber
minnumber
onReset() => void
resetLabelstring
zoomInLabelstring
zoomOutLabelstring
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const [zoom, setZoom] = useState(100);
<ZoomControls value={zoom} onZoomIn={() => setZoom(zoom + 10)} onZoomOut={() => setZoom(zoom - 10)} />