Dot Knob
Like a dial on a synth: a ring of dots lit in the accent up to the value, a body with a line of dots pointing at it, and the value underneath. Drag up or right to turn it up (Shift for fine work), scroll on it, click the ring to jump there, or use the arrow keys, Page Up and Down, Home and End. It's a slider to screen readers.
Needs: None. Canvas 2D.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | – | The value. Leave unset to let the knob keep its own. |
| defaultValue | number | – | The value at first, when value isn't set. |
| onChange | (value: number) => void | – | Called as the value changes. |
| min | number | 0 | The lowest value. |
| max | number | 100 | The highest value. |
| step | number | 1 | The step between values. |
| format | (value: number) => string | – | How the value reads under the knob and to screen readers. |
| tone | string | – | The lit ring's colour. The page's accent by default. |
| pitch | number | 3 | Size of one dot in px. The knob is 23 dots across. |
| disabled | boolean | false | Can't be turned. |
| label | string | "Knob" | What it controls, for screen readers. |
| className | string | – | Class on the knob. |
| style | CSSProperties | – | Style on the knob. |