Inspector Stepper

Settings row for a bounded number: minus and plus either side of a typeable value, with hold-to-repeat, Shift for coarse steps and full keyboard stepping.

Installation

Adds the component and everything it depends on to your project.

npx shadcn add https://ui.beste.co/component/r-base/inspector-stepper

New here? Read the installation guide.

Usage

The import and the props worth knowing about, in one place.

import { InspectorStepper } from "@/components/beste/component/inspector-stepper";

// Uncontrolled
<InspectorStepper label="Columns" min={1} max={6} defaultValue={3} />

// Controlled, with a separate commit for expensive work
<InspectorStepper
  label="Repeat"
  value={repeat}
  onValueChange={setRepeat}                             // every step
  onValueCommit={(value) => console.log("persist", value)} // button or key release
  min={1}
  max={20}
/>

// Fractional steps set the decimals shown, and a unit can trail the number
<InspectorStepper label="Duration" min={0} max={5} step={0.25} suffix="s" defaultValue={1.5} />
<InspectorStepper label="Offset" min={-40} max={40} suffix="px" defaultValue={0} />

<InspectorStepper
  label="Gap"
  icon={Ruler}           // optional leading icon
  tone="outline"         // "muted" (default) | "outline" | "ghost"
  size="sm"              // "sm" | "default" | "lg"
  min={0}
  max={64}
  step={4}
  value={gap}
  onValueChange={setGap}
/>

// Hold either button to keep stepping; Shift multiplies the step by ten, and the
// value takes arrows, Page Up/Down, Home/End and typed input.
<InspectorStepper label="Delay" name="delay" min={0} max={1000} step={50} suffix="ms" />

Playground

Turn the props on the right; the snippet under them is what you would write to get what you see.

Usage
import { InspectorStepper } from "@/components/beste/component/inspector-stepper";

<InspectorStepper
  label="Columns"
  className="w-72"
  min={1}
  max={6}
  defaultValue={3}
/>

Keyboard and gestures

Every one of these is in the component already. They are listed because a props table cannot mention a gesture, so nothing else on this page can tell you they exist.

Arrow Up / DownOne step.
Shift + ArrowTen steps.
Page Up / Page DownTen steps, without reaching for Shift.
Home / EndJump to the minimum or the maximum.
EnterAccept what was typed into the field.
EscapeThrow the draft away and put the committed value back.
Hold a buttonRepeats, and speeds up the longer it is held.

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
label*stringLabel rendered on the left, inside the row.
iconLucideIconOptional leading icon shown before the label.
valuenumberControlled value. Pair it with `onValueChange`.
defaultValuenumberInitial value in uncontrolled mode. Falls back to `min`.
onValueChange(value: number) => voidFires on every step, key press and accepted keystroke.
onValueCommit(value: number) => voidFires once a change is finished — a button release, a key release, a typed value accepted on Enter or blur — and only when the value actually changed.
minnumber0Minimum value.
maxnumber100Maximum value.
stepnumber1Amount one step moves. Also sets how many decimals the value shows.
suffixstringMuted unit after the number, e.g. "px", "%", "ms".
disabledbooleanBlock interaction and dim the row.
tone"muted" | "outline" | "ghost""muted"Surface treatment: filled (default), hairline outline, or bare until hover.
size"sm" | "default" | "lg""default"Row height preset.
namestringName of the underlying input, so the row can take part in a form.
idstringId of the input. Generated when omitted, to tie the label to it.
classNamestring
aria-labelstringAccessible name. Falls back to the visible label.

More Inspector components

View all Inspector
135°

Inspector Angle

Settings row for a direction: a dial you drag round, reading in degrees the way CSS does (zero up, growing clockwise), with a range input underneath carrying the keyboard and the form.

Inspector Range

Settings row for a span rather than a value: two thumbs on the row itself, the band between them filling it, and both ends of the pair read out on the right. Ticks, tones and thumb states follow inspector-slider exactly, appearing on hover.

Dark Mode

Inspector Segmented

Settings row whose choices sit side by side on the right, with a marker that slides between them: the readable alternative to a switch when the two states deserve names, and the compact one to a select at three or four options.

Inspector Aspect

Settings row for a ratio: the row prints it and draws it, and opens an editor with the ratios worth a name plus both sides always editable. It is kept as two numbers rather than as their quotient, since 16:9 is what a reader recognises.

Inspector Gradient

Settings row for a gradient: the row shows a strip of it, and opens an editor with draggable stops over the ramp, so one colour can hold a wider share than the next. The kind, the direction and the selected stop's colour and offset sit under it as rows of the family.

Inspector Position

Settings row for a point on a surface: the row names the nine spots CSS names and shows the rest as two percentages, and opens a square pad the point is dragged around, with the thirds drawn on it and a pull towards them.