Ui component
Design a specific UI component (button, input, modal, card, tabs, table, etc.). Use when the user is creating or improving a single component, specifying its variants and states, or producing component documentation for a design system.From its SKILL.md
npx -y skills add rafa-js/product-designer --skill ui-componentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.2 KB, as published. Nobody here has run it
UI Component Design
Design one component thoroughly. Get the anatomy, states, and edge cases right; the rest is composition.
Inputs to confirm
- Which component: name and intended role.
- Existing tokens: does the product have a visual language already? (Type scale, spacing, radius, color.)
- Platform: web, iOS, Android, cross-platform.
- Variants needed: e.g., primary/secondary/ghost button, or just one.
- Where it's used: knowing the surroundings prevents over-designing.
Method
1. Anatomy
Sketch (or describe) the component's parts. Name them so they can be referenced in docs:
- Container (background, border, radius, padding)
- Content (text, icon, image, action)
- State layer (translucent overlay for hover/pressed/focus/selected — see Material's pattern)
- Focus indicator (must be visible and distinct from hover)
2. Variants
What axes of variation matter? Common ones:
- Hierarchy (primary, secondary, ghost, destructive)
- Size (sm, md, lg)
- Density (default, compact)
- Tone (neutral, success, warning, error, info)
- With/without (icon, label, helper text)
Pick the smallest variant set that covers the real use cases. Pruning a variant is much harder than adding one later.
3. States
For every variant, define every state:
default·hover·focus·active/pressed·selected·disabled·loading·error(if validatable)
Disabled needs a reason affordance (tooltip, helper text) — bare disabled is hostile.
4. Tokens used
List every token the component consumes:
- Color tokens (text, background, border per state)
- Spacing tokens (padding, gap)
- Radius token
- Type token (size + weight + line-height)
- Motion tokens (duration + easing for state transitions)
If you find yourself reaching for a hex or px value, you're missing a token — propose it.
5. Behavior & accessibility
Specify keyboard, screen reader, and ARIA:
- Tab order (component is one stop or multiple?)
- Activation keys (Enter, Space, arrows)
- Escape behavior (if applicable)
- ARIA role, state, name
- Focus management (trap / restore for modals)
- Live-region announcements if state changes silently
Pull defaults from references/04-ux-foundations/accessibility.md (per-component cheat table).
6. Edge cases
For each, describe behavior:
- Empty content
- Maximum content / text overflow (truncate, wrap, scroll?)
- Long words (URLs, IDs) without spaces
- RTL languages
- Slow network (component renders before content loads)
- No JavaScript / interactivity disabled
7. Optical adjustments
Where pure math gives a wrong-looking result, override:
- Icon-only button: optical center, not bounding box.
- Mixed icon + label button: equal vertical padding around the label's cap line, not the box.
- Chip text: slightly higher than vertical center to compensate for descenders.
See references/08-ui-and-design-systems/optical-effects.md.
8. Do / Don't
Two short lists of concrete examples — these are what design system docs actually get read for.
Output
A single doc with these headings (in this order): Anatomy · Variants · States · Tokens · Behavior & a11y · Edge cases · Optical notes · Do/Don't · Open questions.
Pair with hi-fi visuals if the user is providing or expecting them; otherwise the spec stands alone for engineering.
Common mistakes to avoid
- Inventing a snowflake component for one use; usually a variant of an existing component fits.
- Skipping
disabledandloadingstates. - Designing only the happy path of content; long names break the design.
- Pretty visuals without keyboard interaction spec — engineers will improvise badly.
- A button that doesn't communicate destructiveness for destructive actions.
When to delegate
- The token system itself is missing →
visual-languageskill. - This component changes the broader system →
design-systemskill. - Reviewing whether the component is needed at all →
design-reviewskill.