Skip to main content

Knob

Turn a value on a round dial by dragging, scrolling or the arrow keys.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
labelstring-The name above the knob, which also names it to screen readers.
The name above the knob, which also names it to screen readers.
defaultValuenumber-
valuenumber-
onValueChange(value: number) => void-Called with the new value.
Called with the new value.
minnumber0The lowest value.
The lowest value.
maxnumber100The highest value.
The highest value.
stepnumber1The amount one step moves.
The amount one step moves.
centeredbooleanfalseFills the arc from the top, for a value with a middle, such as balance.
Fills the arc from the top, for a value with a middle, such as balance.
ticksbooleanfalseDraws a tick at each step, for a knob with a few settings.
Draws a tick at each step, for a knob with a few settings.
unitstring-Text after the value, such as %.
Text after the value, such as %.
formatValue(value: number) => string-Writes the value under the knob, and reads it to screen readers.
Writes the value under the knob, and reads it to screen readers.
namestring-Submits the value with a form under this name.
Submits the value with a form under this name.
sizesm | md | lgmdThe dial's size.
The dial's size.
disabledbooleanfalseBlocks turning and dims the knob.
Blocks turning and dims the knob.
animatedbooleantrue
classNamestring-
focusboolean | stringtrue