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.

135°

Installation

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

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

New here? Read the installation guide.

Usage

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

import { InspectorAngle } from "@/components/beste/component/inspector-angle";

// Uncontrolled
<InspectorAngle label="Angle" defaultValue={135} />

// Controlled, with a separate commit for expensive work
<InspectorAngle
  label="Rotation"
  value={angle}
  onValueChange={setAngle}                              // every frame of the drag
  onValueCommit={(value) => console.log("persist", value)} // on release
/>

<InspectorAngle
  label="Direction"
  icon={Compass}         // optional leading icon
  snapStep={45}          // degrees the drag snaps to while Shift is held; 15 by default
  step={1}               // what one arrow key moves
  tone="outline"         // "muted" (default) | "outline" | "ghost"
  size="sm"              // "sm" | "default" | "lg"
  value={angle}
  onValueChange={setAngle}
/>

// Values wrap, so 370 arrives as 10, and the row takes part in a form
<InspectorAngle label="Sweep" name="sweep" defaultValue={0} />

Playground

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

135°
Usage
import { InspectorAngle } from "@/components/beste/component/inspector-angle";

<InspectorAngle
  label="Angle"
  className="w-72"
  defaultValue={135}
/>

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 keysOne step around the dial. Up and Right turn it clockwise, Down and Left back.
Shift + ArrowTen steps, for crossing a quadrant without dragging.
Page Up / Page DownOne `snapStep`, so a dial that snaps to 15° moves a notch at a time.
Home / EndZero, or one step short of a full turn.
Drag the dialFollows the pointer; the readout stays a field you can type into.

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 angle in degrees, measured the way CSS measures a gradient: zero points up, and the value grows clockwise. Values wrap, so 370 is 10.
defaultValuenumberInitial angle in uncontrolled mode.
onValueChange(value: number) => voidFires on every frame of a drag, and on every key press.
onValueCommit(value: number) => voidFires once a change is finished — the dial released, a key released. Use it for work too expensive to run per frame.
stepnumber1Smallest increment a key press moves.
snapStepnumber15Degrees the dial snaps to while Shift is held during a drag.
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 range input, so the row can take part in a form.
idstringId of the underlying range input, for an external `<label htmlFor>`.
classNamestring
aria-labelstringAccessible name. Falls back to `label`.

More Inspector components

View all Inspector

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.

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.

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.

Inspector Spacing

Settings row for the four edges of a box: the row carries a CSS-shorthand summary, and opens a cross where each field sits on the edge it sets, tied together or not.

Inspector Filters

Settings row for a CSS filter stack, all ten functions of it: the row shows the whole stack applied to something, and opens an editor holding the nine numeric filters as rows of the family plus a drop shadow section, over a preview large enough to judge.

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.