#038
Default
Two segmented controls: a text-only Week/Month/Year period and a List/Grid view switch with icons.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Default" pattern (@codeatlasdev/ui demo #038, inputs/segmented-control) in my app.
Call get_demo({ ids: ["#038"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Switching a view mode or time range inline above a list, chart or dashboard.
Keep these library parts, with the props and tokens the demo uses:
- SegmentedControl from "@codeatlasdev/ui"
Behaviour to keep:
- Period control `aria-label="Period"` with `bind:value={period}` and 3 items: Week, Month, Year
- Current value is shown as `value: {period}`
- View control `aria-label="View"` with 2 items using `icon: LayoutList` and `icon: LayoutGrid`
- Icons come from `@lucide/svelte`
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
- SegmentedControl
@codeatlasdev/ui
How it is built
- Period control `aria-label="Period"` with `bind:value={period}` and 3 items: Week, Month, Year
- Current value is shown as `value: {period}`
- View control `aria-label="View"` with 2 items using `icon: LayoutList` and `icon: LayoutGrid`
- Icons come from `@lucide/svelte`
Related
Loading source.