UI Component
Overview
Part of StyleSeed, this skill generates components that respect the Toss seed's design language instead of improvising ad hoc markup and styling. It emphasizes semantic tokens, predictable typing, reusable variants, and mobile-friendly accessibility defaults.
When to Use
- Use when you need a new UI primitive or composed component inside a StyleSeed-based project
- Use when you want a component to match the existing Toss seed conventions
- Use when a component should be reusable, typed, and design-token driven
- Use when the AI might otherwise invent spacing, colors, or interaction patterns
How It Works
Step 1: Read the Local Design Context
Before generating code, inspect the seed's source of truth:
CLAUDE.md for conventions
css/theme.css for semantic tokens
- at least one representative component from
components/ui/
If the user already has a better local example, follow the local codebase over a generic template.
Step 2: Choose the Correct Home
Place the output where it belongs:
src/components/ui/ for primitives and low-level building blocks
src/components/patterns/ for composed sections or multi-part patterns
Do not create a new primitive if an existing one can be extended safely.
Step 3: Follow the Structural Rules
Use these defaults unless the host project strongly disagrees:
- function declaration instead of a
const component
React.ComponentProps<> or equivalent native prop typing
className passthrough support
cn() or the project's standard class merger
data-slot for component identification
- CVA or equivalent only when variants are genuinely needed
Step 4: Use Semantic Tokens Only
Do not hardcode visual values if the design system has a token for them.
Preferred examples:
bg-card
text-foreground
text-muted-foreground
border-border
shadow-[var(--shadow-card)]
Step 5: Preserve StyleSeed Typography and Spacing
- Use the scale already defined by the seed
- Prefer multiples of 6px
- Use logical spacing utilities where supported
- Keep display and heading text tight, body text readable, captions restrained
Step 6: Bake in Accessibility
- Touch targets should be at least 44x44px for interactive elements
- Keyboard focus must be visible
- Pass through
aria-* attributes where appropriate
- Respect reduced-motion preferences for nonessential motion
Output
Provide:
- The generated component
- The target path
- Any required imports or dependencies
- Notes on variants, tokens, or follow-up integration work
Best Practices
- Compose from existing primitives before inventing new ones
- Keep the component API small and predictable
- Prefer semantic layout classes over arbitrary values
- Export named components unless the host project uses another standard consistently
Additional Resources
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Core Process
- Analyze the component requirements and verify it doesn't already exist.
- Scaffold the component using StyleSeed spacing, typography, and color tokens.
- Implement all interactive states (hover, focus, active, disabled).
- Test the component mobile-first to ensure touch target sizes are adequate.
Common Rationalizations
| Rationalization |
Reality |
| I'll just copy this component from another project. |
Fails to adhere to StyleSeed Toss conventions and design tokens. |
| This component doesn't need to support mobile, it's for the dashboard. |
All StyleSeed components must be built mobile-first. |
| I'll hardcode the padding because it looks better. |
Violates the strict spacing discipline enforced by StyleSeed tokens. |
Red Flags
- Component is not mobile-first.
- Spacing and typography do not use StyleSeed tokens.
- Missing interactive states (hover, focus, active).
Verification
1---2name: ui-component3description: Use when generating a new UI component that follows StyleSeed Toss conventions for structure, tokens, accessibility, and ergonomics.4---56# UI Component78## Overview910Part of [StyleSeed](https://github.com/bitjaru/styleseed), this skill generates components that respect the Toss seed's design language instead of improvising ad hoc markup and styling. It emphasizes semantic tokens, predictable typing, reusable variants, and mobile-friendly accessibility defaults.1112## When to Use13- Use when you need a new UI primitive or composed component inside a StyleSeed-based project14- Use when you want a component to match the existing Toss seed conventions15- Use when a component should be reusable, typed, and design-token driven16- Use when the AI might otherwise invent spacing, colors, or interaction patterns1718## How It Works1920### Step 1: Read the Local Design Context2122Before generating code, inspect the seed's source of truth:23- `CLAUDE.md` for conventions24- `css/theme.css` for semantic tokens25- at least one representative component from `components/ui/`2627If the user already has a better local example, follow the local codebase over a generic template.2829### Step 2: Choose the Correct Home3031Place the output where it belongs:32- `src/components/ui/` for primitives and low-level building blocks33- `src/components/patterns/` for composed sections or multi-part patterns3435Do not create a new primitive if an existing one can be extended safely.3637### Step 3: Follow the Structural Rules3839Use these defaults unless the host project strongly disagrees:40- function declaration instead of a `const` component41- `React.ComponentProps<>` or equivalent native prop typing42- `className` passthrough support43- `cn()` or the project's standard class merger44- `data-slot` for component identification45- CVA or equivalent only when variants are genuinely needed4647### Step 4: Use Semantic Tokens Only4849Do not hardcode visual values if the design system has a token for them.5051Preferred examples:52- `bg-card`53- `text-foreground`54- `text-muted-foreground`55- `border-border`56- `shadow-[var(--shadow-card)]`5758### Step 5: Preserve StyleSeed Typography and Spacing5960- Use the scale already defined by the seed61- Prefer multiples of 6px62- Use logical spacing utilities where supported63- Keep display and heading text tight, body text readable, captions restrained6465### Step 6: Bake in Accessibility6667- Touch targets should be at least 44x44px for interactive elements68- Keyboard focus must be visible69- Pass through `aria-*` attributes where appropriate70- Respect reduced-motion preferences for nonessential motion7172## Output7374Provide:751. The generated component762. The target path773. Any required imports or dependencies784. Notes on variants, tokens, or follow-up integration work7980## Best Practices8182- Compose from existing primitives before inventing new ones83- Keep the component API small and predictable84- Prefer semantic layout classes over arbitrary values85- Export named components unless the host project uses another standard consistently8687## Additional Resources8889- [StyleSeed repository](https://github.com/bitjaru/styleseed)90- [Source skill](https://github.com/bitjaru/styleseed/blob/main/seeds/toss/.claude/skills/ui-component/SKILL.md)9192## Limitations93- Use this skill only when the task clearly matches the scope described above.94- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.95- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.969798## Core Process991. Analyze the component requirements and verify it doesn't already exist.1002. Scaffold the component using StyleSeed spacing, typography, and color tokens.1013. Implement all interactive states (hover, focus, active, disabled).1024. Test the component mobile-first to ensure touch target sizes are adequate.103104## Common Rationalizations105| Rationalization | Reality |106|---|---|107| I'll just copy this component from another project. | Fails to adhere to StyleSeed Toss conventions and design tokens. |108| This component doesn't need to support mobile, it's for the dashboard. | All StyleSeed components must be built mobile-first. |109| I'll hardcode the padding because it looks better. | Violates the strict spacing discipline enforced by StyleSeed tokens. |110111## Red Flags112- Component is not mobile-first.113- Spacing and typography do not use StyleSeed tokens.114- Missing interactive states (hover, focus, active).115116## Verification117- [ ] Component structure matches StyleSeed Toss conventions.118- [ ] All spacing, colors, and typography use official design tokens.119- [ ] Component is responsive and tested mobile-first.