#058
States
Six text fields showing description, error, required, read-only, disabled and small size.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "States" pattern (@codeatlasdev/ui demo #058, inputs/text-field) in my app.
Call get_demo({ ids: ["#058"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Reference for validation and availability states of a single-line input.
Keep these library parts, with the props and tokens the demo uses:
- TextField from "@codeatlasdev/ui"
Behaviour to keep:
- Username has `description="3–20 characters, letters and underscores only."`
- Email has `error="Please enter a valid email address."` and `bind:value={wrong}`
- Company has `required`
- Read-only field uses `readonly` and Disabled field uses `disabled`, both `value="Cannot edit this"`
- Small field uses `size="sm"`
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
- TextField
@codeatlasdev/ui
How it is built
- Username has `description="3–20 characters, letters and underscores only."`
- Email has `error="Please enter a valid email address."` and `bind:value={wrong}`
- Company has `required`
- Read-only field uses `readonly` and Disabled field uses `disabled`, both `value="Cannot edit this"`
- Small field uses `size="sm"`
Related
Loading source.