#052
Settings list
Settings list of three rows, each with a title, a subtitle and a Switch.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Settings list" pattern (@codeatlasdev/ui demo #052, inputs/switch) in my app.
Call get_demo({ ids: ["#052"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Account preferences screen with one toggle per setting.
Keep these library parts, with the props and tokens the demo uses:
- Switch from "@codeatlasdev/ui"
Behaviour to keep:
- 3 rows in `.settings-list`: Email notifications, Dark mode, Usage analytics
- Each row has `settings-item__title` and `settings-item__sub` text
- Switches use `bind:checked={email}`, `bind:checked={dark}`, `bind:checked={analytics}`
- Each switch has an `aria-label` matching its row title, e.g. `aria-label="Dark mode"`
- Initial state: email `$state(true)`, dark and analytics `$state(false)`
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
- Switch
@codeatlasdev/ui
How it is built
- 3 rows in `.settings-list`: Email notifications, Dark mode, Usage analytics
- Each row has `settings-item__title` and `settings-item__sub` text
- Switches use `bind:checked={email}`, `bind:checked={dark}`, `bind:checked={analytics}`
- Each switch has an `aria-label` matching its row title, e.g. `aria-label="Dark mode"`
- Initial state: email `$state(true)`, dark and analytics `$state(false)`
Related
Loading source.