Write a design-system component spec
Inputs
component(required): The component to specify, e.g. "toast", "date picker", "segmented control".context(optional): The design system and product it belongs to, existing token names, related components, platforms, and any existing implementation or screenshots. Optional.
Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.
- Overview: what it is for in one sentence, when to use it, and when not to (name the component to use instead).
- Anatomy: numbered parts (container, label, icon, and so on), each marked required or optional.
- Variants and sizes: each variant with the job it does. Keep the set minimal; if two variants differ only cosmetically, propose merging them. Give sizes with the minimum target size each must keep.
- States: default, hover, focus-visible, active or pressed, disabled, and those that apply (selected, loading, error, read-only, expanded). Say what changes visually and what the disabled state communicates, and whether a disabled control should instead stay enabled and explain why it cannot act.
- Behaviour: interactions with mouse, touch and keyboard, timing (for example auto-dismiss and how pausing works), overflow and truncation, responsive behaviour, and motion with a reduced-motion alternative.
- Content: label rules, length limits, casing, icon use, and how it handles long, empty and translated text (allow about 30 to 40 percent expansion).
- Tokens: a table of the semantic tokens each part uses. Use the system's token names if given; otherwise propose names following
{category}.{property}.{variant}.{state}and mark them "proposed". Never hard-code raw values. - Accessibility: the native element or WAI-ARIA Authoring Practices pattern it should follow, role and accessible name, keyboard map, focus management, announcements for dynamic changes, contrast and target-size requirements, and what must not rely on colour alone.
- Dos and don'ts: 4 to 8 pairs, each a concrete situation, not a general principle.
- Related components and how to choose between them.
- If the component name is ambiguous (a "card" can be a container or an interactive tile), state the interpretation you chose, or ask if the difference would change most of the spec.