#046
Single value
Two single-value sliders, Volume and Brightness, each with a live readout.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Single value" pattern (@codeatlasdev/ui demo #046, inputs/slider) in my app.
Call get_demo({ ids: ["#046"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Adjusting a continuous setting such as volume or brightness.
Keep these library parts, with the props and tokens the demo uses:
- Slider from "@codeatlasdev/ui"
Behaviour to keep:
- Volume: `<Slider bind:value={volume} min={0} max={100} />` with initial `$state(60)`
- Brightness: `<Slider bind:value={brightness} min={0} max={100} />` with initial `$state(40)`
- Readouts are `{volume}` and `{brightness}%`
- Wrapper `.col` uses `max-width: 480px`
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- Slider
@codeatlasdev/ui
How it is built
- Volume: `<Slider bind:value={volume} min={0} max={100} />` with initial `$state(60)`
- Brightness: `<Slider bind:value={brightness} min={0} max={100} />` with initial `$state(40)`
- Readouts are `{volume}` and `{brightness}%`
- Wrapper `.col` uses `max-width: 480px`
Related
Loading source.