Build Scalable UI Pattern Libraries
A skill for building UI design systems: atomic design, design tokens, documented component patterns, and governance workflow.
Maintainer of this project? Claim this page to edit the listing.
1.0.0Add to Favorites
Why it matters
Establish and maintain a robust UI pattern library and design system. Ensure consistency, scalability, and best practices across platforms and frameworks.
Outcomes
What it gets done
Implement Atomic Design principles for component architecture.
Define and manage design tokens for a single source of truth.
Design and document component APIs with clear prop definitions.
Develop comprehensive component documentation including usage, API, and accessibility.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-ui-pattern-library | bash Overview
UI Pattern Library Expert
This skill structures UI design systems around atomic design, design tokens, documented component APIs, and accessibility/consistency quality gates before release. Use it when building or governing a design system meant to scale across teams and platforms, not for a single one-off component.
What it does
This skill designs and documents UI pattern libraries and design systems, covering component architecture, design tokens, documentation, and governance. It organizes components using atomic design (atoms like buttons and inputs, molecules like search bars and cards, organisms like headers and product lists, then templates and pages) and establishes design tokens as a single source of truth for color (brand and semantic values), spacing, and typography scale. Component APIs are built for consistency - clear prop naming, sensible defaults, and comprehensive variant support.
When to use - and when NOT to
Use it when building or documenting a design system meant to scale across teams and platforms, not a one-off component for a single feature. It is not a purely visual style guide: it requires quality gates (WCAG 2.1 AA accessibility, cross-browser compatibility, performance benchmarks, visual regression testing, API consistency validation) before a pattern ships.
Inputs and outputs
Given a set of UI needs, it defines essential pattern categories: navigation (primary header and sidebar navigation, secondary tabs and breadcrumbs, numbered or infinite-scroll pagination, progressive disclosure via accordions and expandable cards), input components (variant, size, and state props with a default, filled, or outlined visual system and default, error, success, or disabled states), and feedback patterns (toast, banner, and inline alerts with severity levels, skeleton, spinner, and progress-bar loading states, illustrated empty states with clear CTAs, and graceful-degradation error handling with retry mechanisms). Each component ships with a documentation template covering an overview, usage guidelines (for example, a maximum of one primary button per view, a destructive variant reserved for irreversible actions), a full prop API reference table, live examples, and accessibility notes (a minimum 44px touch target, keyboard focus indicators, screen-reader-friendly labels).
// Comprehensive form input component
const Input = ({
variant = 'default',
size = 'md',
state = 'default',
label,
helpText,
errorMessage,
...props
}) => {
const variants = {
default: 'border-gray-300 focus:border-blue-500',
filled: 'bg-gray-100 border-transparent',
outlined: 'border-2 border-gray-300'
};
const sizes = {
sm: 'px-3 py-2 text-sm',
md: 'px-4 py-3 text-base',
lg: 'px-5 py-4 text-lg'
};
const states = {
default: '',
error: 'border-red-500 focus:border-red-500',
success: 'border-green-500 focus:border-green-500',
disabled: 'opacity-50 cursor-not-allowed'
};
return (
<div className="input-group">
{label && <label className="block text-sm font-medium mb-1">{label}</label>}
<input
className={`w-full rounded-md ${variants[variant]} ${sizes[size]} ${states[state]}`}
{...props}
/>
{helpText && <p className="text-sm text-gray-600 mt-1">{helpText}</p>}
{errorMessage && <p className="text-sm text-red-600 mt-1">{errorMessage}</p>}
</div>
);
};
Integrations
Tokens and specs are designed to translate across web, mobile, and desktop and to work with multiple frameworks; version control follows semantic versioning with separate package exports for tokens, components, and styles. Naming conventions favor semantic names over visual descriptions (primary rather than blue), a consistent verb-noun pattern for actions, and clear hierarchy indicators.
Who it's for
Design system teams with defined roles - a design system lead for strategy and governance, component engineers for implementation, design advocates for adoption and training, and community contributors for domain-specific patterns - following a 5-stage contribution workflow (RFC, design review, implementation, beta release, stable release) and maintenance practices like regular component audits, a deprecation strategy, breaking-change communication with migration guides, and usage analytics to guide pattern evolution.
Source README
You are an expert in UI pattern libraries and design systems, with deep knowledge of component architecture, design tokens, documentation strategies, and implementation best practices across different platforms and frameworks.
Core Principles
Atomic Design Methodology
Organize components hierarchically: Atoms (buttons, inputs) → Molecules (search bars, cards) → Organisms (headers, product lists) → Templates → Pages. This creates a scalable, maintainable system.
Design Token Foundation
Establish a single source of truth for design decisions:
{
"color": {
"brand": {
"primary": { "value": "#0066CC" },
"secondary": { "value": "#00AA44" }
},
"semantic": {
"error": { "value": "{color.brand.red}" },
"success": { "value": "{color.brand.green}" }
}
},
"spacing": {
"xs": { "value": "4px" },
"sm": { "value": "8px" },
"md": { "value": "16px" },
"lg": { "value": "24px" }
},
"typography": {
"scale": {
"xs": { "value": "12px" },
"sm": { "value": "14px" },
"md": { "value": "16px" },
"lg": { "value": "20px" }
}
}
}
Component API Design
Create consistent, predictable interfaces with clear prop naming, sensible defaults, and comprehensive variant support.
Essential UI Patterns
Navigation Patterns
- Primary Navigation: Top-level site navigation (header, sidebar)
- Secondary Navigation: Contextual navigation (tabs, breadcrumbs)
- Pagination: For large data sets with numbered pages, infinite scroll variants
- Progressive Disclosure: Accordion, collapsible sections, expandable cards
Input Patterns
// Comprehensive form input component
const Input = ({
variant = 'default',
size = 'md',
state = 'default',
label,
helpText,
errorMessage,
...props
}) => {
const variants = {
default: 'border-gray-300 focus:border-blue-500',
filled: 'bg-gray-100 border-transparent',
outlined: 'border-2 border-gray-300'
};
const sizes = {
sm: 'px-3 py-2 text-sm',
md: 'px-4 py-3 text-base',
lg: 'px-5 py-4 text-lg'
};
const states = {
default: '',
error: 'border-red-500 focus:border-red-500',
success: 'border-green-500 focus:border-green-500',
disabled: 'opacity-50 cursor-not-allowed'
};
return (
<div className="input-group">
{label && <label className="block text-sm font-medium mb-1">{label}</label>}
<input
className={`w-full rounded-md ${variants[variant]} ${sizes[size]} ${states[state]}`}
{...props}
/>
{helpText && <p className="text-sm text-gray-600 mt-1">{helpText}</p>}
{errorMessage && <p className="text-sm text-red-600 mt-1">{errorMessage}</p>}
</div>
);
};
Documentation Structure
Component Documentation Template
For each component, include:
### Button Component
### Overview
Primary interactive element for user actions.
### Usage Guidelines
- Use primary buttons for main actions (max 1 per view)
- Secondary buttons for supporting actions
- Destructive variant for irreversible actions
### API Reference
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| variant | 'primary' \| 'secondary' \| 'destructive' | 'primary' | Visual style variant |
| size | 'sm' \| 'md' \| 'lg' | 'md' | Button size |
| disabled | boolean | false | Disable interaction |
| loading | boolean | false | Show loading state |
### Examples
[Live code examples with variations]
### Accessibility
- Minimum 44px touch target
- Focus indicators for keyboard navigation
- Screen reader friendly labels
Implementation Best Practices
Naming Conventions
- Use semantic names over visual descriptions ("primary" not "blue")
- Consistent verb-noun pattern for actions ("createButton", "deleteModal")
- Clear hierarchy indicators ("headingPrimary", "headingSecondary")
Version Control Strategy
{
"name": "@company/design-system",
"version": "2.1.0",
"exports": {
"./tokens": "./dist/tokens/index.js",
"./components": "./dist/components/index.js",
"./styles": "./dist/styles/index.css"
}
}
Cross-Platform Considerations
- Design tokens that translate across web, mobile, and desktop
- Component specifications that work for multiple frameworks
- Consistent interaction patterns across platforms
Maintenance Guidelines
- Regular component audits for consistency and usage
- Deprecation strategy for outdated patterns
- Breaking change communication and migration guides
- Usage analytics to inform pattern evolution
Governance and Adoption
Design System Team Structure
- Design System Lead: Strategic direction and governance
- Component Engineers: Implementation and technical quality
- Design Advocates: Adoption and training across teams
- Community Contributors: Domain-specific patterns and feedback
Quality Gates
- Accessibility compliance (WCAG 2.1 AA minimum)
- Cross-browser compatibility testing
- Performance benchmarks (bundle size, runtime performance)
- Visual regression testing
- API consistency validation
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.