1---2name: design-systems3description: Design system principles, component libraries, typography, color theory, spacing systems, and design tokens4---5
6# Design Systems
7
8## Design System Principles
9
10### Core Principles
11- **Consistency**: Ensure consistent visual language and behavior across all products
12- **Scalability**: Design systems that grow with the product and team
13- **Efficiency**: Speed up design and development through reusable components
14- **Accessibility**: Build accessibility into every component from the start
15- **Maintainability**: Create systems that are easy to update and maintain
16- **Documentation**: Document everything thoroughly for clear adoption
17
18### Design System Structure
19- **Foundations**: Colors, typography, spacing, icons, elevation
20- **Components**: Reusable UI elements with documented variations
21- **Patterns**: Common solutions to recurring design problems
22- **Templates**: Page layouts and screen structures
23- **Guidelines**: Usage rules and best practices
24- **Resources**: Assets, downloads, and implementation guides
25
26## Component Libraries
27
28### Popular Component Libraries
29- **Material Design**: Google's design system with comprehensive components
30- **Ant Design**: Enterprise-class UI design language and React components
31- **Tailwind CSS**: Utility-first CSS framework with design tokens
32- **shadcn/ui**: Beautiful, accessible components built with Radix UI and Tailwind
33- **Chakra UI**: Simple, modular and accessible component library
34- **MUI**: React components that implement Google's Material Design
35
36### Component Design Principles
37- **Single Responsibility**: Each component should have one clear purpose
38- **Composability**: Components should be composable and flexible
39- **Predictable Behavior**: Components should behave consistently
40- **Accessible**: All components must meet WCAG AA standards
41- **Responsive**: Components must work across all device sizes
42- **Documented**: Each component has clear documentation and examples
43
44### Component States
45- **Default**: Normal state of the component
46- **Hover**: When user hovers over the component
47- **Focus**: When component has keyboard focus
48- **Active**: When component is being activated
49- **Disabled**: When component is not available
50- **Loading**: When component is in a loading state
51- **Error**: When component has an error state
52
53## Typography
54
55### Typography Fundamentals
56- **Font Families**: Choose font families that are readable and on-brand
57- **Font Weights**: Use a limited number of weights (regular, medium, bold)
58- **Font Sizes**: Establish a type scale with consistent ratios
59- **Line Height**: Use appropriate line height for readability (1.4-1.6)
60- **Letter Spacing**: Adjust letter spacing for headings and uppercase text
61- **Text Alignment**: Left-align for body text, center for short headings
62
63### Type Scale
64- **Modular Scale**: Use a mathematical scale for consistent sizing
65- **Common Ratios**: Major third (1.25), Perfect fourth (1.33), Golden ratio (1.618)
66- **Responsive Typography**: Scale text size based on viewport width
67- **Clamp Function**: Use CSS clamp() for fluid typography
68- **Text Scaling**: Support text scaling up to 200% for accessibility
69
70### Typography Hierarchy
71- **H1**: Main page title, largest size
72- **H2**: Section headings
73- **H3**: Subsection headings
74- **H4-H6**: Minor headings
75- **Body**: Main content text
76- **Caption**: Supporting text, labels
77- **Overline**: Category labels, small uppercase text
78
79## Color Theory
80
81### Color Fundamentals
82- **Primary Color**: Main brand color, used for primary actions
83- **Secondary Color**: Supporting brand color, used for accents
84- **Neutral Colors**: Grays for text, backgrounds, borders
85- **Semantic Colors**: Success, warning, error, info colors
86- **Color Palettes**: Create shades and tints of each color
87- **Color Contrast**: Ensure WCAG AA compliance (4.5:1 for normal text)
88
89### Color Systems
90- **HSL**: Hue, Saturation, Lightness - easier for designers to work with
91- **RGB**: Red, Green, Blue - used for digital displays
92- **HEX**: Hexadecimal - common in web design
93- **Design Tokens**: Store colors as tokens for consistency
94- **Dark Mode**: Create dark mode variants of all colors
95
96### Color Usage Guidelines
97- **60-30-10 Rule**: 60% neutral, 30% primary, 10% accent
98- **Limit Palette**: Use 5-7 colors maximum for clarity
99- **Meaningful Colors**: Use color to convey meaning consistently
100- **Accessibility First**: Ensure all color combinations meet contrast requirements
101- **Color Blindness**: Consider color blind users when choosing palettes
102
103## Spacing Systems
104
105### Spacing Fundamentals
106- **Spacing Scale**: Use a consistent scale (4px, 8px, 16px, 24px, 32px, 48px, 64px)
107- **4px Base Grid**: Use 4px as the base unit for spacing
108- **Consistent Application**: Apply spacing consistently across components
109- **Responsive Spacing**: Adjust spacing for different screen sizes
110- **Whitespace**: Use whitespace effectively to improve readability
111
112### Spacing Types
113- **Padding**: Space inside elements
114- **Margin**: Space outside elements
115- **Gap**: Space between flex/grid items
116- **Inset**: Shorthand for top, right, bottom, left spacing
117
118## Icon Systems
119
120### Icon Fundamentals
121- **Icon Style**: Choose a consistent icon style (outline, filled, duotone)
122- **Icon Size**: Establish standard sizes (16px, 24px, 32px, 48px)
123- **Icon Library**: Use an established icon library (Material Icons, Lucide, Heroicons)
124- **Custom Icons**: Create custom icons when needed, maintain consistency
125- **Accessibility**: Include aria-label or aria-hidden for icons
126
127### Icon Guidelines
128- **Meaningful**: Icons should be universally understood
129- **Simple**: Keep icons simple and clear
130- **Consistent**: Use consistent stroke width and style
131- **Scalable**: Icons should look good at all sizes
132- **Labeled**: Always provide text labels for icons
133
134## Illustration Guidelines
135
136### Illustration Style
137- **Consistent Style**: Maintain consistent illustration style across all illustrations
138- **Color Palette**: Use brand colors for illustrations
139- **Purpose**: Use illustrations to support content, not decorate
140- **Accessibility**: Ensure illustrations don't distract from content
141- **Loading States**: Use illustrations for empty and loading states
142
143## Design Tokens
144
145### Token Fundamentals
146- **Naming Convention**: Use clear, descriptive names (color-primary-500)
147- **Categories**: Organize tokens by category (color, spacing, typography)
148- **Aliases**: Create aliases for semantic tokens (color-text-primary)
149- **Platform Support**: Support multiple platforms (web, iOS, Android)
150- **Documentation**: Document all tokens with examples
151
152### Token Types
153- **Color Tokens**: Colors for backgrounds, text, borders, etc.
154- **Spacing Tokens**: Padding, margin, gap values
155- **Typography Tokens**: Font families, sizes, weights, line heights
156- **Border Radius Tokens**: Rounded corner values
157- **Shadow Tokens**: Elevation and shadow values
158- **Animation Tokens**: Duration, easing, delay values
159
160## Design System Documentation
161
162### Documentation Structure
163- **Overview**: Introduction to the design system
164- **Foundations**: Colors, typography, spacing, icons
165- **Components**: Each component with examples and guidelines
166- **Patterns**: Common design patterns and solutions
167- **Guidelines**: Usage rules and best practices
168- **Resources**: Downloads, assets, and implementation guides
169
170### Documentation Best Practices
171- **Live Examples**: Show live, interactive examples
172- **Code Snippets**: Provide code for each component
173- **Do's and Don'ts**: Show correct and incorrect usage
174- **Accessibility Notes**: Include accessibility requirements
175- **Changelog**: Track changes and updates
176- **Versioning**: Use semantic versioning for releases