Build production-ready frontend components with accessible markup, sensible props, defined states, and tested behavior. Use this skill whenever the user wants to build a component from scratch, refactor an existing one, design a component API, or implement a UI element with proper states and accessibility. Triggers on build a component, create a button, create a modal, create a form input, component API, props design, component states, refactor component, accessible component. Also triggers when implementing UI from a design that needs to be reusable.
63
74%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/frontend-component-build/SKILL.mdBuild production-ready components. Stack-agnostic principles. Most patterns translate to React, Vue, Svelte, or vanilla web components.
This skill is about implementing a component well. For broader system design see design-system. For day-to-day visual decisions see design-standards.
design-system)design-standards)code-review-web)performance-optimization)A complete component handles six dimensions. Skip any one and the component is incomplete.
Identify the parts that make up the component before writing any markup.
Common anatomies:
Naming the parts up front makes the API obvious.
What variations does the component support?
Variants should be a managed set, not a free-for-all. Document the supported set; reject requests for new variants without a real use case.
What states must the component handle?
Every state needs visual treatment AND accessibility treatment.
Design the component's contract.
API design principles:
variant: "primary" | "secondary" | "ghost" over primary={true} ghost={false}.headerText and bodyText props when slots work.Build it accessible from the start. Adding accessibility later is 5x harder.
Universal:
<button>, <a>, <nav>, <form>, etc.) over generic <div>Component-specific:
<button>. Don't fake one with a <div>.role="dialog" and aria-labelledby.for/id or aria-labelledby. Error messages linked via aria-describedby. aria-invalid when in error state.<button> with aria-pressed for two-state, or role="switch" for on/off.role="tablist" / role="tab" / role="tabpanel" with aria-selected and arrow-key navigation.aria-live so screen readers know something changed.Verify the component works before declaring it done.
Test types by priority:
A component without at least automated accessibility testing is not done.
<div> for interactive things.<div onClick>. Loses keyboard accessibility, screen reader semantics, and focus. Use <button> or <a>.<Button primary large rounded fullWidth disabled icon />. Too many booleans means you actually need fewer variants designed more thoughtfully.aria-disabled AND not respond to clicks.aria-live="polite" or role="status".A complete component delivery includes:
references/component-spec-template.md - Template for documenting a component (props, states, accessibility, edge cases) before building.references/component-api-patterns.md - Common patterns for designing flexible component APIs (compound components, controlled vs uncontrolled, polymorphic as prop, render props, slots).references/accessibility-patterns.md - ARIA patterns for common interactive components.8e70d03
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.