#074
Open by default
A Collapsible that starts expanded with its open state bound and printed below it.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Open by default" pattern (@codeatlasdev/ui demo #074, surfaces/collapsible) in my app.
Call get_demo({ ids: ["#074"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Panels that should be visible on first load, or whose open state the app tracks.
Keep these library parts, with the props and tokens the demo uses:
- Collapsible from "@codeatlasdev/ui"
Behaviour to keep:
- `<Collapsible title="Expanded on mount" bind:open>`
- State: `let open = $state(true)` starts the panel open
- `<p class="state">open = {open}</p>` prints the bound value
- Wrapped in `.wrap` with `max-width: 560px`
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
- Collapsible
@codeatlasdev/ui
How it is built
- `<Collapsible title="Expanded on mount" bind:open>`
- State: `let open = $state(true)` starts the panel open
- `<p class="state">open = {open}</p>` prints the bound value
- Wrapped in `.wrap` with `max-width: 560px`
Related
Loading source.