Skip to content
Theme

Scrub field

A number field for a design tool. Drag its label sideways to scrub the value, type it, or step it with the arrow keys.

Examples

Drag a label sideways, type, or step with the arrow keys

Type

px
‰

Props

ScrubField

A number field for a design tool: drag its label sideways to scrub the value, type it, or step it with the arrow keys (Shift for ten steps).

PropTypeDefaultDescription
labelstring—Shown before the input, where dragging changes the value; also its accessible name.
valuenumber—
onChange(value: number) => void—
step?number1One step: an arrow key, or a pixel dragged. Shift makes it ten.
minValue?number—
maxValue?number—
unit?string—A unit shown after the number, such as "px" or "‰".
isDisabled?booleanfalse

Keyboard

KeyDoes
ArrowUp or ArrowDownOne step up or down
Shift + ArrowUp or ArrowDownTen steps

Accessibility

  • A spin button named by its label; dragging the label is a pointer shortcut, never the only way.