Exposure Slider
betaA camera-style exposure dial: a draggable ruler of notches under a fixed centre mark, with a value ring.
- Forms
- 1 file
- 2 npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add exposure-slidernpm packages installed: class-variance-authority, radix-ui.
import { ExposureSlider } from "@/components/ui/exposure-slider";Default
Gallery
Stops
Without Indicator
Disabled
Right To Left
<ExposureSlider>
| Prop | Type | Default |
|---|---|---|
accent | "primary" | "warning" | "destructive" | "success" | "info" | "foreground" | "warning" |
defaultValueInitial value when uncontrolled. | number | 0 |
disabled | boolean | false |
formatValueFormats the value for the ring and for | (value: number) => string | String |
largeStepSteps moved by Page Up / Page Down. | number | 10 |
max | number | 20 |
min | number | -20 |
nameSubmits the value with a form under this name. | string | — |
onValueChangeCalled on every change — each notch crossed while dragging, each key press. | (value: number) => void | — |
onValueCommitCalled when an interaction ends: pointer released, or a key press. | (value: number) => void | — |
showIndicatorShow the ring with the current value above the ruler. | boolean | true |
step | number | 1 |
valueControlled value. | number | — |
Plus every attribute of <div> except defaultValue, onChange, children.
The ruler is a focusable role="slider" with aria-valuenow, -valuemin, -valuemax and an aria-valuetext taken from formatValue. Arrow keys move one step (Left/Right follow the reading direction), Page Up/Down move largeStep, Home/End jump to the ends — so the drag is never the only way to set it. aria-label and aria-labelledby passed to the component land on the slider, and a development warning fires when it has no name. The ring and notches are aria-hidden: the slider already reports the value. The settle animation is a CSS transition and stops under reduced motion.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes