NotchDial
A ticker you drag sideways. Notches slide under a fixed centre mark, the one under it turns accent and tall, and it snaps to the nearest step. A ring fills from zero either way. Inputs.
Open playgroundDrag sideways, or focus it and use the arrow keys.
About
NotchDial is a React component in the Inputs category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { NotchDial } from "@ashutoshswamy/smoui" and set value, min, onChange among its 6 props.
Install
npm i @ashutoshswamy/smouiUsage
import { NotchDial } from "@ashutoshswamy/smoui";
<NotchDial min={-20} max={20} defaultValue={0} onChange={(v) => console.log(v)} />Props 6
- value / defaultValue
Controlled or starting value.
number- min / max / step
Range and step. Default -20, 20, 1.
number- onChange
Fires as the value crosses each notch.
(value: number) => void- showRing
The ring above. Default true.
boolean- format
Readout text. Default signed.
(value: number) => string- label
Accessible name.
string
More inputs components
- AddressAutocompleteType a street and pick from live suggestions. Lookups wait for a pause, show a spinner and drop stale answers. Picking confirms the full address underneath.
- AvatarPickerPick an avatar from a grid. One accent ring glides to your choice, the big preview swaps on a spring, arrow keys move across the grid and Shuffle rolls a random one.
- AvatarUploadDrop or choose a photo, then frame it under a crop circle. The stage shows the whole photo, the circle shows what you keep, and three live previews follow every move. Drag, zoom or use the arrow keys.
- CheckboxBox squashes on press, fills with the accent and draws its tick in.
- ChipA selectable pill. Selecting it tints it and slides a tick in at the front while the pill grows; an optional close button removes it.
- ColorPickerSaturation field and hue strip with jelly thumbs on springs. Edit the hex, pick a swatch, or use arrow keys.