#157
Left and right
Two buttons that open a left navigation drawer and a right settings drawer.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Left and right" pattern (@codeatlasdev/ui demo #157, navigation/drawer) in my app.
Call get_demo({ ids: ["#157"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Slide-in panels for site navigation on mobile or for quick settings without leaving the page.
Keep these library parts, with the props and tokens the demo uses:
- Drawer, Button from "@codeatlasdev/ui"
Behaviour to keep:
- `<Drawer bind:open={leftOpen} side="left" title="Navigation">` holds a `<nav class="nav" aria-label="Demo navigation">` with 4 links: Home, Components, Foundation, About
- Left links close it with `onclick={() => (leftOpen = false)}`
- `<Drawer bind:open={rightOpen} side="right" title="Settings">` lists 3 label and value rows: Theme Amber, Language English, Notifications Enabled
- Triggers are `Button` with `variant="outlined"`, the second with `{#snippet leading()}<Settings size={16} stroke-width={2} />{/snippet}`
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
How it is built
- `<Drawer bind:open={leftOpen} side="left" title="Navigation">` holds a `<nav class="nav" aria-label="Demo navigation">` with 4 links: Home, Components, Foundation, About
- Left links close it with `onclick={() => (leftOpen = false)}`
- `<Drawer bind:open={rightOpen} side="right" title="Settings">` lists 3 label and value rows: Theme Amber, Language English, Notifications Enabled
- Triggers are `Button` with `variant="outlined"`, the second with `{#snippet leading()}<Settings size={16} stroke-width={2} />{/snippet}`
Related
Loading source.