#163
Controlled
Tabs bound to a state variable with a line below showing the active tab value.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Controlled" pattern (@codeatlasdev/ui demo #163, navigation/tabs) in my app.
Call get_demo({ ids: ["#163"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Tabbed views whose active tab must also drive other UI or be read and set from code.
Keep these library parts, with the props and tokens the demo uses:
- Tabs, TabsList, TabsTrigger, TabsContent from "@codeatlasdev/ui"
Behaviour to keep:
- `<Tabs bind:value={active}>` with `let active = $state('overview')`
- `<TabsList>` holds 3 `TabsTrigger` items: `value="overview"`, `value="props"`, `value="examples"`
- A matching `TabsContent` per value, each with a one-line `<div class="panel">`
- State is echoed as `Active tab: <code>{active}</code>`
- Wrapper is `.wrap` with `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
- Tabs
@codeatlasdev/ui - TabsList
@codeatlasdev/ui - TabsTrigger
@codeatlasdev/ui - TabsContent
@codeatlasdev/ui
How it is built
- `<Tabs bind:value={active}>` with `let active = $state('overview')`
- `<TabsList>` holds 3 `TabsTrigger` items: `value="overview"`, `value="props"`, `value="examples"`
- A matching `TabsContent` per value, each with a one-line `<div class="panel">`
- State is echoed as `Active tab: <code>{active}</code>`
- Wrapper is `.wrap` with `max-width: 480px`
Related
Loading source.