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 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.
formatsets the value both shown in the dial and read out (35%,-20 dB).sweepis the arc in degrees, gap at the bottom.labelshows under the dial. Inside a Field the field's label names it instead.
Usage
ts
import { BlessKnob } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | — | |
min | number | 0 | |
max | number | 100 | |
step | number | 1 | |
size | "md" | "sm" | "lg" | "md" | |
label | string | — | visible label under the dial; inside a BlessField the field's label is used instead |
showValue | boolean | true | |
format | ((v: number) => string) | — | |
disabled | boolean | — | |
sweep | number | 270 | degrees of arc, centred at the bottom gap |
modelValue | number | 0 |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: number] |