component-docs
БесплатноБез исполняемых скриптовНе проверенGenerates component API documentation with props tables, usage examples, and guidelines. Use when documenting component libraries, creating API references, or…
от dylantarre★ 56 звёзд на GitHubОб этом скилле
Component Documentation Generator
Overview
Generate comprehensive component documentation including API references, usage examples, accessibility guidelines, and design specifications. Create documentation that serves both designers and developers.
When to Use
- Documenting new components
- Creating component API references
- Writing usage guidelines
- Building a design system documentation site
Quick Reference: Documentation Sections
| Section | Purpose | Audience |
|---|---|---|
| Overview | What the component does | All |
| When to Use | Decision guidance | Designers |
| Props/API | Technical reference | Developers |
| Examples | Code snippets | Developers |
| Variants | Visual options | All |
| States | Interactive states | Designers |
| Accessibility | A11y guidelines | All |
| Design Specs | Spacing, tokens used | Designers |
| Do/Don't | Usage guidance | All |
The Process
- Identify component scope: What does it do, what doesn't it do?
- Define props interface: All configurable options
- Create examples: Basic, advanced, edge cases
- Document variants: Visual variations
- Add accessibility: ARIA, keyboard, screen reader
- Include design specs: Spacing, colors, typography tokens
- Write guidelines: When to use, when not to
Component Documentation Template
# Button
Buttons allow users to take actions and make choices with a single tap.
## Overview
The Button component is used for triggering actions. Use buttons to submit forms,
navigate between pages, or trigger in-page functionality.
## When to Use
| Scenario | Recommendation |
|----------|----------------|
| Primary action | Use `variant="primary"` |
| Secondary action | Use `variant="secondary"` |
| Destructive action | Use `variant="danger"` |
| Navigation | Consider using a Link instead |
| In forms | Use `type="submit"` |
## Import
```tsx
import { Button } from '@acme/design-system';
Basic Usage
<Button onClick={handleClick}>Click me</Button>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
'primary' | 'secondary' | 'ghost' | 'danger' |
'primary' |
Visual style variant |
size |
'sm' | 'md' | 'lg' |
'md' |
Button size |
disabled |
boolean |
false |
Disables the button |
loading |
boolean |
false |
Shows loading spinner |
fullWidth |
boolean |
false |
Makes button 100% width |
leftIcon |
ReactNode |
- | Icon before text |
rightIcon |
ReactNode |
- | Icon after text |
type |
'button' | 'submit' | 'reset' |
'button' |
HTML button type |
onClick |
(event: MouseEvent) => void |
- | Click handler |
children |
ReactNode |
- | Button label |
Variants
Primary
Use for the main action on a page or in a form.
<Button variant="primary">Save changes</Button>
Secondary
Use for secondary actions that support the primary action.
<Button variant="secondary">Cancel</Button>
Ghost
Use for tertiary actions or in dense UIs.
<Button variant="ghost">Learn more</Button>
Danger
Use for destructive actions like delete.
<Button variant="danger">Delete account</Button>
Sizes
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
| Size | Height | Font Size | Use Case |
|---|---|---|---|
sm |
32px | 14px | Compact UIs, tables |
md |
40px | 16px | Default, most uses |
lg |
48px | 18px | Hero sections, emphasis |
States
Default
<Button>Default</Button>
Hover
Slightly darkened background. Applied automatically on mouse hover.
Active
Pressed state with slight scale reduction.
Focus
Focus ring appears on keyboard focus (focus-visible).
Disabled
<Button disabled>Disabled</Button>
- 50% opacity
- Cursor changes to not-allowed
- Click events are ignored
Loading
<Button loading>Saving...</Button>
- Shows spinner icon
- Button is disabled
- Label remains for width consistency
aria-busy="true"for screen readers
With Icons
// Icon before text
<Button leftIcon={<PlusIcon />}>Add item</Button>
// Icon after text
<Button rightIcon={<ArrowRightIcon />}>Continue</Button>
// Icon only (use aria-label)
<Button aria-label="Settings">
<SettingsIcon />
</Button>
Full Width
<Button fullWidth>Sign up</Button>
Button Groups
<div className="button-group">
<Button variant="secondary">Cancel</Button>
<Button variant="primary">Save</Button>
</div>
Accessibility
Keyboard Navigation
| Key | Action |
|---|---|
Tab |
Move focus to button |
Enter |
Activate button |
Space |
Activate button |
ARIA
- Uses native
<button>element aria-disabledwhen disabled (maintains focusability)aria-busywhen loadingaria-pressedfor t
Установить component-docs в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл component-docs?
Generates component API documentation with props tables, usage examples, and guidelines. Use when documenting component libraries, creating API references, or building component documentation for designers and developers.
Как установить скилл component-docs?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл component-docs запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic