#045
Range
Two-thumb range slider from 0 to 100 with the selected price range printed beside it.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Range" pattern (@codeatlasdev/ui demo #045, inputs/slider) in my app.
Call get_demo({ ids: ["#045"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Filtering by a numeric range such as price.
Keep these library parts, with the props and tokens the demo uses:
- Slider from "@codeatlasdev/ui"
Behaviour to keep:
- `<Slider bind:values={range} min={0} max={100} />`
- `range` is `$state<[number, number]>([20, 75])`
- Row shows a Price label and the value `${range[0]} – ${range[1]}`
- Wrapper `.row` 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
- `<Slider bind:values={range} min={0} max={100} />`
- `range` is `$state<[number, number]>([20, 75])`
- Row shows a Price label and the value `${range[0]} – ${range[1]}`
- Wrapper `.row` uses `max-width: 480px`
Related
Loading source.