Skip to content

Range Dial

A precision rotary control with an illuminated arc and fine ticks.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import RangeDial from "./RangeDial";
export default function Example() {
return (
<RangeDial
defaultValue={68}
min={0}
max={100}
step={1}
unit={"%"}
label={"Intensity"}
size={260}
accentColor={"#d4baf1"}
trackColor={"#ffffff16"}
disabled={false}
/>
);
}

Using Range Dial

Set min, max, step, and unit to describe the measurement being adjusted. label names the control.

Use value with onChange for form state, or defaultValue for an initial reading. size determines how much room the dial and its ticks need.

Props

NameTypeRequiredDefaultDescription
valuenumberNoundefinedOptional controlled numeric value.
defaultValuenumberNo50Initial value when uncontrolled.
onChangefunctionNoundefinedCalled with the new numeric value after pointer or keyboard input.
minnumberNo0Minimum value.
maxnumberNo100Maximum value. Values at or below min disable interaction.
stepnumberNo1Value increment for pointer and native keyboard input.
unitstringNo""Suffix shown after the value.
labelstringNo""Visible and accessible control label.
sizenumberNo240Preferred dial diameter in pixels, capped to container width.
accentColorstringNo"#d4baf1"Filled arc, ticks, and handle colour.
trackColorstringNo"#ffffff16"Unfilled arc and tick colour.
disabledbooleanNofalseDisable pointer and keyboard input.
classNamestringNo""Additional CSS classes, merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.

Related components

A recessed password field pairs a reveal control with an optional strength indicator.

Editable tags collect inside a softly framed input with individual remove controls.

A recessed search field expands into a polished capsule as you type.

Faceted stars lift into selection with a small marker beneath the chosen rating.