Create a Detailed Component Library Specification Document

Build a comprehensive component library spec with variants, props, accessibility rules, and code examples for your design system.

๐Ÿ“ The Prompt

Act as a senior design systems architect. Create a detailed component library specification for a [APPLICATION TYPE, e.g., 'B2B SaaS dashboard'] built with [TECH STACK, e.g., 'React and Tailwind CSS']. The design system should support [DESIGN PRIORITIES, e.g., 'scalability, accessibility, and consistency across 5+ product teams']. For each component listed below, provide a full specification: Components to specify: [LIST OF COMPONENTS, e.g., 'Button, Input Field, Modal, Card, Toast Notification, Data Table, Dropdown Menu, Avatar, Badge, Tabs'] For EACH component, document the following: 1. **Component Name & Description:** A concise summary of the component's purpose and when to use it (vs. similar components). 2. **Variants:** List all visual variants (e.g., primary, secondary, ghost, destructive) with descriptions of when each variant is appropriate. 3. **Props/API Surface:** Define the key props including name, type, default value, and whether required or optional. Present in a table format. 4. **States:** Enumerate all interactive states (default, hover, active, focus, disabled, loading, error) and describe the visual changes for each. 5. **Sizing:** Define size options (sm, md, lg, xl) with specific pixel or rem dimensions for padding, font size, height, and icon size. 6. **Accessibility Requirements:** Specify required ARIA attributes, keyboard interaction patterns, focus management rules, and screen reader announcements. 7. **Content Guidelines:** Define character limits, truncation behavior, and copy dos/don'ts. 8. **Composition Rules:** Explain how this component composes with other components and any forbidden combinations. 9. **Code Example:** Provide one usage snippet showing the most common implementation. End with a dependency map showing relationships between components.

๐Ÿ’ก Tips for Better Results

Start with your 5-8 most-used components rather than trying to spec everything at once โ€” you can iterate and add more in follow-up prompts. Include your actual tech stack so the props and code examples match your real implementation environment. Feed the output back and ask the AI to generate a Storybook story or unit test for each component to extend the value.

๐ŸŽฏ Use Cases

Best for design system leads, frontend architects, and product teams building or scaling a shared component library across multiple teams or products.

๐Ÿ”— Related Prompts

๐ŸŽจ Design intermediate

UI/UX Design Review Checklist

Get a comprehensive UI/UX review covering hierarchy, accessibility, and responsiveness.

๐ŸŽจ Design intermediate

Generate a Custom Color Palette for Any Brand or Project

Generate a complete, accessible color palette with HEX values, usage guidelines, and dark mode variants for any brand or project.

๐ŸŽจ Design intermediate

Find the Perfect Typography Pairing for Your Design Project

Get expert typography pairing recommendations with type scales, spacing guidelines, and CSS fallback stacks for any design project.

๐ŸŽจ Design advanced

Create a Detailed Wireframe Description for UI/UX Design

Generate a detailed, section-by-section wireframe description with layout specs, interaction flows, and responsive behavior for any page.

๐ŸŽจ Design intermediate

Generate a Custom Color Palette for Your Brand or Project

Generate a complete, accessible color palette with hex codes, usage guidelines, dark mode variants, and brand-aligned reasoning.

๐ŸŽจ Design advanced

Create a Detailed User Flow Diagram for Your Digital Product

Design a comprehensive text-based user flow diagram with decision points, error states, and UX annotations for any digital product.