#049
Theme presets
Swatch group of five theme presets: ocean, violet, emerald, rose, amber.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Theme presets" pattern (@codeatlasdev/ui demo #049, inputs/swatch-group) in my app.
Call get_demo({ ids: ["#049"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Choosing an accent theme preset in appearance settings.
Keep these library parts, with the props and tokens the demo uses:
- SwatchGroup from "@codeatlasdev/ui"
Behaviour to keep:
- `<SwatchGroup` with `aria-label="Accent"` and `bind:value={preset}`
- 5 items with only `value`: `{ value: 'ocean' }`, `{ value: 'violet' }`, `{ value: 'emerald' }`, `{ value: 'rose' }`, `{ value: 'amber' }`
- Initial value is `$state('ocean')`
- Current value is shown as `value: {preset}`
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
- SwatchGroup
@codeatlasdev/ui
How it is built
- `<SwatchGroup` with `aria-label="Accent"` and `bind:value={preset}`
- 5 items with only `value`: `{ value: 'ocean' }`, `{ value: 'violet' }`, `{ value: 'emerald' }`, `{ value: 'rose' }`, `{ value: 'amber' }`
- Initial value is `$state('ocean')`
- Current value is shown as `value: {preset}`
Related
Loading source.