Skip to content

Knob ​

Rotary dial on a native range input

For compact settings in a dense panel — a mixer, an editor's inspector — where a row of knobs fits in the width one slider takes. Anywhere else use Slider: the whole range is visible and it is more precise with a mouse.

Basic
drag the dial · keyboard via the native range
  • Drag round the dial, or click a point on it. Turning past either end holds at that end instead of wrapping to the other.
  • The keyboard is the native range underneath: arrows step, Page Up/Down jump, Home/End go to the ends.
  • format sets the value both shown in the dial and read out (35%, -20 dB). sweep is the arc in degrees, gap at the bottom.
  • label shows under the dial. Inside a Field the field's label names it instead.

Usage ​

ts
import { BlessKnob } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
idstring—
minnumber0
maxnumber100
stepnumber1
size"md" | "sm" | "lg""md"
labelstring—visible label under the dial; inside a BlessField the field's label is used instead
showValuebooleantrue
format((v: number) => string)—
disabledboolean—
sweepnumber270degrees of arc, centred at the bottom gap
modelValuenumber0

Events

NamePayloadDescription
update:modelValue[value: number]

Released under the MIT License. Character names and artwork belong to their owners.