Form
Knob
A dial for a bounded number, set by dragging, pressing anywhere on it or the keyboard.
WAI-ARIA tested
Import
main.ts
import { Knob } from '@vitral/vue';Basic
Volume
Range, step and size
Read-only and disabled
API
Read from packages/vue/src/components/Knob/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| min | number | Defaults to 0. |
| max | number | Defaults to 100. |
| step | number | Defaults to 1. |
| size | number | The dial's width and height, in pixels. Defaults to 100. |
| strokeWidth | number | The thickness of the arc, in pixels. Defaults to 14. |
| showValue | boolean | Show the value in the middle. Defaults to true. |
| valueTemplate | string | How the value is written, in the middle and to assistive technology: `'{value}%'`. Defaults to `'{value}'`. |
| valueColor | string | Overrides the value arc's colour. |
| rangeColor | string | Overrides the track's colour. |
| textColor | string | Overrides the text's colour. |
| readonly | boolean | — |
| disabled | boolean | — |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| change | value: number | The value was changed by the reader: a drag ended or a key was pressed. |