Skip to content
Back to skills

Build Ui Component

ASecurity

Builds a typed, accessible UI component from a description or screenshot, with loading, empty and error states and a usage example. Use when adding a component to a frontend.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 26, 2026
ai-agentsgoreactvueangularapifrontend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill build-ui-component --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Build Ui Component?

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

Security grade badge for Build Ui Component
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-build-ui-component/badge)](https://www.skillsdirectory.com/skills/hermes-hq-build-ui-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: build-ui-component
description: Builds a typed, accessible UI component from a description or screenshot, with loading, empty and error states and a usage example. Use when adding a component to a frontend.
license: CC0-1.0
arguments:
  - description
  - framework
  - styling
argument-hint: <description> [framework] [styling]
disable-model-invocation: true
metadata:
  version: 1.0.0
  kind: prompt
  category: implementation
  source: https://hermes-ide.com/prompts/build-ui-component
  catalog: 2026.1014.1
---

# Build a reusable UI component

## Inputs

- `description` (required): What the component shows and does, or a screenshot plus notes. Include the data it receives and the actions it emits.
- `framework` (optional; one of: react, vue, svelte, angular, web-components; default: react): UI framework.
- `styling` (optional; default: match project): Styling approach, for example CSS modules, Tailwind or the design-system tokens.

Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.

<context>
Components built from a mock-up usually cover only the state in the mock-up. In production the data is late, empty, failing, or three times longer than the design assumed, and someone is using a keyboard or a screen reader. A reusable component also needs an API other engineers can guess: typed props, sensible defaults, composition instead of a pile of boolean flags, and no hard-coded copy.
</context>

<task>
Build a $framework component from this description:

$description

Styling: $styling (when it says "match project", find and use the project's existing approach and design tokens).

1. If you were given an image, list what you can read from it (layout, hierarchy, text, controls) separately from what you are guessing (exact spacing, colours, hover states). Map colours and spacing to the nearest existing tokens instead of hard-coding values.
2. Find two existing components in the repo and copy their file layout, naming, prop style, styling method and test approach.
3. Design the API: typed props with defaults; controlled and uncontrolled use if it holds state; slots or children for content that varies; callbacks named for intent (`onSelect`, not `onClick2`). Expose a ref to the root element (a `ref` prop in React 19, `forwardRef` before it) and pass remaining attributes and class names through where the framework allows it.
4. Implement every state that applies: default, loading (skeleton or spinner with `aria-busy`), empty (message plus a next action), error (message plus retry), disabled, and overflow (long text, many items, narrow viewport).
5. Build accessibility in: native elements first (`button`, `a`, `input`, `dialog`), an accessible name for every control, full keyboard operation, visible focus, contrast from the tokens, and respect for `prefers-reduced-motion`.
6. Take all user-visible text through props or the project's i18n layer. Hard-code no copy.
7. Write tests in the project's framework for each state, the main interactions (including by keyboard), and the callbacks. Add an automated accessibility check if the project already uses one. Add a story or demo entry if the project has Storybook or similar.
</task>

<constraints>
- No new dependencies unless the description requires one; prefer what the project has.
- Do not change shared tokens, global styles or other components.
- If the description and existing design-system components overlap, reuse or extend the existing one and say so instead of building a duplicate.
- Do only what was asked. If you notice something else worth changing, mention it in one line at the end instead of changing it.
- Keep the change as small as it can be while still being correct.
- Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
- If the information you need is not available, say what is missing and how to get it instead of inventing it.
</constraints>

<output_format>
## Assumptions
What you inferred or guessed, one line each.

## API
| Prop | Type | Default | Description |

## Code
Each file in its own code block, headed by its path.

## Tests
One line per test: what it proves.

## Usage
A short example covering the default and error states.
</output_format>

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.