Skip to content
Back to skills

Component

ASecurity

Scaffold a reusable UI component with typed props, variants, and explicit loading/empty/error states

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsgofrontend

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill component --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Component?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Component
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-component/badge)](https://www.skillsdirectory.com/skills/black141312-component)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: component
description: Scaffold a reusable UI component with typed props, variants, and explicit loading/empty/error states
category: frontend
---

# Component

Reach for this when adding a new reusable UI component that other parts of the app will compose, not a one-off page section.

1. Define the component's contract first: required vs optional props, their types, and sensible defaults; prefer a small surface over a kitchen-sink config.
2. Place the file next to siblings following the repo's existing convention (folder-per-component or flat); match casing, file extension, and export style of neighbors.
3. Implement the markup with semantic elements and forward `className`/`style` and a `ref` where the host element is interactive.
4. Model variants and sizes as discrete props (e.g. `variant`, `size`) mapped to classes, not as free-form style overrides.
5. Handle the non-happy paths explicitly: loading, empty, disabled, and error renders — never assume data is present.
6. Add a usage example or story plus a minimal test that renders the component and asserts key props/states.

## Rules
- Keep components presentational; lift data fetching and side effects to a parent or hook.
- Type every prop; avoid `any` and avoid spreading untyped `...props` onto the DOM.
- Don't hardcode colors, spacing, or copy — pull from tokens/theme and pass text via props or children.
- One responsibility per component; if it grows branches, split it.
- Mirror existing naming and folder patterns instead of inventing a new structure.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…