#041
Empty-value option
Select whose first option has an empty value labelled All projects, with the raw value printed.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Empty-value option" pattern (@codeatlasdev/ui demo #041, inputs/select) in my app.
Call get_demo({ ids: ["#041"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Filters where an empty value means no filter, such as All projects.
Keep these library parts, with the props and tokens the demo uses:
- Select from "@codeatlasdev/ui"
Behaviour to keep:
- `<Select label="Project" placeholder="Choose a project…"` with `options={projects}`
- `projects` has 4 options: All projects with `value: ''`, Web app, API, Docs
- `bind:value={project}` with initial `$state('')`
- Current value is shown as `JSON.stringify(project)`
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
- Select
@codeatlasdev/ui
How it is built
- `<Select label="Project" placeholder="Choose a project…"` with `options={projects}`
- `projects` has 4 options: All projects with `value: ''`, Web app, API, Docs
- `bind:value={project}` with initial `$state('')`
- Current value is shown as `JSON.stringify(project)`
Related
Loading source.