---
title: "Design tokens a component library system - AI Prompt"
description: "Vytvoř design tokens systém a component library s konzistentními vlastnostmi napříč platformami. Hotový prompt s proměnnými – zkopírujte a použijte v ChatGPT,..."
image: "https://zacinamsai.cz/images/og-default.jpg"
---

Kreativní  Expert  Claude 

# Design tokens a component library system

Vytvoř design tokens systém a component library s konzistentními vlastnostmi napříč platformami.

  ##   Prompt text 

 **Délka:** Dlouhý 

Navrhni design tokens systém pro [PRODUKT/APLIKACE]. Platformy: [WEB/MOBILE/DESKTOP]. Framework: [REACT/VUE/FLUTTER/SWIFT]. Design tool: [FIGMA/SKETCH/XD]. Struktura: 1) **Token Architecture** - token hierarchy (global → alias → component), naming convention (category-property-variant-state), semantic vs literal tokens, token categories (color, spacing, typography, shadows, borders, animations), 2) **Color Tokens** - primitive colors (brand.green.500), semantic colors (color.text.primary, color.bg.success), theme variants (light/dark mode), alpha variants (opacity levels), usage documentation, 3) **Spacing Tokens** - base unit (4px or 8px grid), scale system (4, 8, 12, 16, 24, 32, 48, 64, 96px), semantic names (space.xs, space.sm, space.md), responsive modifiers (space.sm-mobile vs space.sm-desktop), 4) **Typography Tokens** - font families (font.primary, font.mono), font sizes (fontSize.xs to fontSize.3xl), line heights (lineHeight.tight, lineHeight.relaxed), font weights (fontWeight.normal, fontWeight.bold), letter spacing, 5) **Component Tokens** - button tokens (button.primary.bg, button.primary.text, button.height.md), input tokens (input.border, input.focus.ring), card tokens (card.padding, card.shadow), 6) **Shadow &amp; Elevation** - shadow levels (shadow.sm to shadow.2xl), elevation scale (z-index system), blur &amp; spread values, 7) **Border &amp; Radius** - border widths (1px, 2px, 4px), border radius scale (radius.sm to radius.full), 8) **Animation Tokens** - duration (duration.fast 150ms, duration.normal 300ms), easing functions (easing.easeIn, easing.spring), 9) **Implementation** - JSON/YAML format, CSS variables output, platform-specific exports (iOS Swift, Android XML, React Native, Flutter), build pipeline (Style Dictionary), 10) **Component Library** - atomic design structure (atoms, molecules, organisms), component variants, prop API design, composition patterns, storybook documentation. Zahrň code examples a config files.

  [  Interaktivní tvůrce ](https://zacinamsai.cz/prompts/design-tokens-a-component-library/builder) 

 ##   Příklad použití 

### Vstup:

Produkt: Fitness tracking app "FitFlow". Platformy: React Native (iOS/Android) a React web. Design tool: Figma. Base: 8px grid system.

### Výstup:

\# Design Tokens &amp; Component Library: FitFlow  

\## 1. Token Architecture  

**Token Hierarchy:**  
&#96;&#96;&#96;  
Global Tokens (Primitives)  
 ↓  
Alias Tokens (Semantic)  
 ↓  
Component Tokens (Specific)  
&#96;&#96;&#96;  

**Example Flow:**  
&#96;&#96;&#96;json  
// Global (literal color)  
"color.blue.500": "#3B82F6"  

// Alias (semantic meaning)  
"color.primary": "{color.blue.500}"  

// Component (specific use)  
"button.primary.bg": "{color.primary}"  
&#96;&#96;&#96;  

**Naming Convention:**  
&#96;&#96;&#96;  
[category]-[property]-[variant]-[state]  

Examples:  
color-text-primary (base state)  
color-text-primary-hover (interaction state)  
space-padding-card (component-specific)  
fontSize-heading-xl (size variant)  
&#96;&#96;&#96;  

**Token Categories:**  
1. **Color** - Brand, semantic, state colors  
2. **Spacing** - Margins, padding, gaps  
3. **Typography** - Fonts, sizes, weights, line heights  
4. **Shadows** - Elevation, depth  
5. **Borders** - Widths, radii  
6. **Animation** - Durations, easing  
7. **Breakpoints** - Responsive design  
8. **Z-index** - Layering  

**Semantic vs Literal:**  
&#96;&#96;&#96;json  
// ❌ Literal (hard to maintain)  
"buttonBackground": "#3B82F6"  

// ✅ Semantic (flexible)  
"buttonBackground": "{color.primary}"  
// Now changing brand color updates all buttons  
&#96;&#96;&#96;  

---  

\## 2. Color Tokens  

\### Primitive Colors (Brand Palette)  
&#96;&#96;&#96;json  
{  
 "color": {  
 "brand": {  
 "blue": {  
 "50": "#EFF6FF",  
 "100": "#DBEAFE",  
 "200": "#BFDBFE",  
 "300": "#93C5FD",  
 "400": "#60A5FA",  
 "500": "#3B82F6", // Primary  
 "600": "#2563EB",  
 "700": "#1D4ED8",  
 "800": "#1E40AF",  
 "900": "#1E3A8A"  
 },  
 "green": {  
 "500": "#10B981", // Success/Activity  
 "600": "#059669"  
 },  
 "red": {  
 "500": "#EF4444", // Error/Heart rate  
 "600": "#DC2626"  
 },  
 "yellow": {  
 "500": "#F59E0B" // Warning/Calories  
 }  
 },  
 "gray": {  
 "50": "#F9FAFB",  
 "100": "#F3F4F6",  
 "200": "#E5E7EB",  
 "300": "#D1D5DB",  
 "400": "#9CA3AF",  
 "500": "#6B7280",  
 "600": "#4B5563",  
 "700": "#374151",  
 "800": "#1F2937",  
 "900": "#111827"  
 }  
 }  
}  
&#96;&#96;&#96;  

\### Semantic Color Tokens  
&#96;&#96;&#96;json  
{  
 "color": {  
 // Text  
 "text": {  
 "primary": "{color.gray.900}",  
 "secondary": "{color.gray.600}",  
 "disabled": "{color.gray.400}",  
 "inverse": "#FFFFFF",  
 "link": "{color.brand.blue.600}",  
 "error": "{color.brand.red.600}",  
 "success": "{color.brand.green.600}"  
 },  
 // Backgrounds  
 "bg": {  
 "primary": "#FFFFFF",  
 "secondary": "{color.gray.50}",  
 "tertiary": "{color.gray.100}",  
 "inverse": "{color.gray.900}",  
 "success": "{color.brand.green.50}",  
 "error": "{color.brand.red.50}",  
 "warning": "{color.brand.yellow.50}"  
 },  
 // Borders  
 "border": {  
 "default": "{color.gray.200}",  
 "hover": "{color.gray.300}",  
 "focus": "{color.brand.blue.500}",  
 "error": "{color.brand.red.500}"  
 },  
 // Interactive  
 "interactive": {  
 "primary": "{color.brand.blue.500}",  
 "primary-hover": "{color.brand.blue.600}",  
 "primary-pressed": "{color.brand.blue.700}",  
 "secondary": "{color.gray.200}",  
 "secondary-hover": "{color.gray.300}"  
 }  
 }  
}  
&#96;&#96;&#96;  

\### Theme Variants (Light/Dark)  
&#96;&#96;&#96;json  
{  
 "light": {  
 "color.text.primary": "#111827",  
 "color.bg.primary": "#FFFFFF"  
 },  
 "dark": {  
 "color.text.primary": "#F9FAFB",  
 "color.bg.primary": "#111827"  
 }  
}  
&#96;&#96;&#96;  

\### Alpha Variants (Opacity)  
&#96;&#96;&#96;json  
{  
 "color": {  
 "overlay": {  
 "light": "rgba(0, 0, 0, 0.5)", // 50% black  
 "dark": "rgba(0, 0, 0, 0.75)", // 75% black  
 "inverse": "rgba(255, 255, 255, 0.9)" // 90% white  
 },  
 "scrim": "rgba(0, 0, 0, 0.32)" // Modal backdrop  
 }  
}  
&#96;&#96;&#96;  

**Usage Documentation:**  
&#96;&#96;&#96;  
color.text.primary → Body text, headlines  
color.text.secondary → Captions, metadata  
color.interactive.primary → CTA buttons, links  
color.bg.success → Success alerts background  
&#96;&#96;&#96;  

---  

\## 3. Spacing Tokens  

**Base Unit: 8px Grid System**  
&#96;&#96;&#96;json  
{  
 "space": {  
 "0": "0px",  
 "1": "4px", // 0.5x  
 "2": "8px", // 1x (base)  
 "3": "12px", // 1.5x  
 "4": "16px", // 2x  
 "5": "20px", // 2.5x  
 "6": "24px", // 3x  
 "8": "32px", // 4x  
 "10": "40px", // 5x  
 "12": "48px", // 6x  
 "16": "64px", // 8x  
 "20": "80px", // 10x  
 "24": "96px" // 12x  
 }  
}  
&#96;&#96;&#96;  

**Semantic Spacing Names:**  
&#96;&#96;&#96;json  
{  
 "space": {  
 "xs": "{space.1}", // 4px  
 "sm": "{space.2}", // 8px  
 "md": "{space.4}", // 16px  
 "lg": "{space.6}", // 24px  
 "xl": "{space.8}", // 32px  
 "2xl": "{space.12}", // 48px  
 "3xl": "{space.16}" // 64px  
 }  
}  
&#96;&#96;&#96;  

**Component-Specific Spacing:**  
&#96;&#96;&#96;json  
{  
 "space": {  
 "button": {  
 "paddingX": "{space.4}", // 16px horizontal  
 "paddingY": "{space.2}", // 8px vertical  
 "gap": "{space.2}" // 8px icon-text gap  
 },  
 "card": {  
 "padding": "{space.4}", // 16px all sides  
 "gap": "{space.3}" // 12px between elements  
 },  
 "layout": {  
 "gutter": "{space.4}", // 16px grid gutter  
 "section": "{space.12}" // 48px section spacing  
 }  
 }  
}  
&#96;&#96;&#96;  

**Responsive Modifiers:**  
&#96;&#96;&#96;json  
{  
 "space": {  
 "container": {  
 "mobile": "{space.4}", // 16px on mobile  
 "tablet": "{space.6}", // 24px on tablet  
 "desktop": "{space.8}" // 32px on desktop  
 }  
 }  
}  
&#96;&#96;&#96;  

---  

\## 4. Typography Tokens  

**Font Families:**  
&#96;&#96;&#96;json  
{  
 "font": {  
 "primary": "Inter, -apple-system, BlinkMacSystemFont, sans-serif",  
 "mono": "'JetBrains Mono', 'Courier New', monospace",  
 "display": "'Poppins', sans-serif" // For headlines  
 }  
}  
&#96;&#96;&#96;  

**Font Sizes (Type Scale):**  
&#96;&#96;&#96;json  
{  
 "fontSize": {  
 "xs": "12px", // 0.75rem  
 "sm": "14px", // 0.875rem  
 "base": "16px", // 1rem (default)  
 "lg": "18px", // 1.125rem  
 "xl": "20px", // 1.25rem  
 "2xl": "24px", // 1.5rem  
 "3xl": "30px", // 1.875rem  
 "4xl": "36px", // 2.25rem  
 "5xl": "48px", // 3rem  
 "6xl": "64px" // 4rem  
 }  
}  
&#96;&#96;&#96;  

**Line Heights:**  
&#96;&#96;&#96;json  
{  
 "lineHeight": {  
 "none": "1",  
 "tight": "1.25",  
 "snug": "1.375",  
 "normal": "1.5",  
 "relaxed": "1.625",  
 "loose": "2"  
 }  
}  
&#96;&#96;&#96;  

**Font Weights:**  
&#96;&#96;&#96;json  
{  
 "fontWeight": {  
 "light": "300",  
 "normal": "400",  
 "medium": "500",  
 "semibold": "600",  
 "bold": "700",  
 "extrabold": "800"  
 }  
}  
&#96;&#96;&#96;  

**Letter Spacing:**  
&#96;&#96;&#96;json  
{  
 "letterSpacing": {  
 "tighter": "-0.05em",  
 "tight": "-0.025em",  
 "normal": "0em",  
 "wide": "0.025em",  
 "wider": "0.05em",  
 "widest": "0.1em"  
 }  
}  
&#96;&#96;&#96;  

**Typography Presets:**  
&#96;&#96;&#96;json  
{  
 "typography": {  
 "h1": {  
 "fontFamily": "{font.display}",  
 "fontSize": "{fontSize.4xl}",  
 "fontWeight": "{fontWeight.bold}",  
 "lineHeight": "{lineHeight.tight}",  
 "letterSpacing": "{letterSpacing.tight}"  
 },  
 "body": {  
 "fontFamily": "{font.primary}",  
 "fontSize": "{fontSize.base}",  
 "fontWeight": "{fontWeight.normal}",  
 "lineHeight": "{lineHeight.normal}",  
 "letterSpacing": "{letterSpacing.normal}"  
 },  
 "caption": {  
 "fontFamily": "{font.primary}",  
 "fontSize": "{fontSize.sm}",  
 "fontWeight": "{fontWeight.normal}",  
 "lineHeight": "{lineHeight.snug}",  
 "color": "{color.text.secondary}"  
 }  
 }  
}  
&#96;&#96;&#96;  

---  

\## 5. Component Tokens  

\### Button Tokens  
&#96;&#96;&#96;json  
{  
 "button": {  
 "primary": {  
 "bg": "{color.interactive.primary}",  
 "bg-hover": "{color.interactive.primary-hover}",  
 "bg-pressed": "{color.interactive.primary-pressed}",  
 "bg-disabled": "{color.gray.200}",  
 "text": "#FFFFFF",  
 "text-disabled": "{color.gray.400}",  
 "border": "transparent"  
 },  
 "secondary": {  
 "bg": "transparent",  
 "bg-hover": "{color.gray.100}",  
 "text": "{color.interactive.primary}",  
 "border": "{color.interactive.primary}"  
 },  
 "height": {  
 "sm": "32px",  
 "md": "40px",  
 "lg": "48px"  
 },  
 "paddingX": {  
 "sm": "{space.3}", // 12px  
 "md": "{space.4}", // 16px  
 "lg": "{space.6}" // 24px  
 },  
 "borderRadius": "8px",  
 "fontSize": {  
 "sm": "{fontSize.sm}",  
 "md": "{fontSize.base}",  
 "lg": "{fontSize.lg}"  
 },  
 "fontWeight": "{fontWeight.semibold}",  
 "shadow": "{shadow.sm}",  
 "shadow-hover": "{shadow.md}"  
 }  
}  
&#96;&#96;&#96;  

\### Input Tokens  
&#96;&#96;&#96;json  
{  
 "input": {  
 "bg": "{color.bg.primary}",  
 "border": "{color.border.default}",  
 "border-hover": "{color.border.hover}",  
 "border-focus": "{color.border.focus}",  
 "border-error": "{color.border.error}",  
 "text": "{color.text.primary}",  
 "placeholder": "{color.text.secondary}",  
 "height": "44px", // Touch-friendly  
 "paddingX": "{space.3}",  
 "borderRadius": "8px",  
 "fontSize": "{fontSize.base}",  
 "focus": {  
 "ring": "0 0 0 3px rgba(59, 130, 246, 0.1)" // Blue glow  
 }  
 }  
}  
&#96;&#96;&#96;  

\### Card Tokens  
&#96;&#96;&#96;json  
{  
 "card": {  
 "bg": "{color.bg.primary}",  
 "border": "{color.border.default}",  
 "padding": "{space.4}",  
 "borderRadius": "12px",  
 "shadow": "{shadow.sm}",  
 "shadow-hover": "{shadow.md}"  
 }  
}  
&#96;&#96;&#96;  

---  

\## 6. Shadow &amp; Elevation  

**Shadow Levels:**  
&#96;&#96;&#96;json  
{  
 "shadow": {  
 "none": "none",  
 "xs": "0 1px 2px 0 rgba(0, 0, 0, 0.05)",  
 "sm": "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",  
 "md": "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",  
 "lg": "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",  
 "xl": "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",  
 "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",  
 "inner": "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"  
 }  
}  
&#96;&#96;&#96;  

**Elevation Scale (Z-Index):**  
&#96;&#96;&#96;json  
{  
 "zIndex": {  
 "base": "0",  
 "dropdown": "1000",  
 "sticky": "1100",  
 "fixed": "1200",  
 "modal-backdrop": "1300",  
 "modal": "1400",  
 "popover": "1500",  
 "tooltip": "1600",  
 "notification": "1700"  
 }  
}  
&#96;&#96;&#96;  

**Usage:**  
&#96;&#96;&#96;  
shadow.sm → Cards, buttons (resting state)  
shadow.md → Cards on hover, dropdowns  
shadow.lg → Modals, overlays  
shadow.2xl → Hero images, featured content  
&#96;&#96;&#96;  

---  

\## 7. Border &amp; Radius  

**Border Widths:**  
&#96;&#96;&#96;json  
{  
 "borderWidth": {  
 "0": "0px",  
 "1": "1px",  
 "2": "2px",  
 "4": "4px",  
 "8": "8px"  
 }  
}  
&#96;&#96;&#96;  

**Border Radius Scale:**  
&#96;&#96;&#96;json  
{  
 "borderRadius": {  
 "none": "0px",  
 "sm": "4px",  
 "md": "8px",  
 "lg": "12px",  
 "xl": "16px",  
 "2xl": "24px",  
 "3xl": "32px",  
 "full": "9999px" // Pills, circles  
 }  
}  
&#96;&#96;&#96;  

**Usage:**  
&#96;&#96;&#96;  
radius.sm → Input fields, small buttons  
radius.md → Cards, buttons (default)  
radius.lg → Large cards, modals  
radius.full → Avatar, pill buttons, badges  
&#96;&#96;&#96;  

---  

\## 8. Animation Tokens  

**Duration:**  
&#96;&#96;&#96;json  
{  
 "duration": {  
 "instant": "0ms",  
 "fast": "150ms",  
 "normal": "300ms",  
 "slow": "500ms",  
 "slower": "700ms"  
 }  
}  
&#96;&#96;&#96;  

**Easing Functions:**  
&#96;&#96;&#96;json  
{  
 "easing": {  
 "linear": "cubic-bezier(0, 0, 1, 1)",  
 "easeIn": "cubic-bezier(0.4, 0, 1, 1)",  
 "easeOut": "cubic-bezier(0, 0, 0.2, 1)",  
 "easeInOut": "cubic-bezier(0.4, 0, 0.2, 1)",  
 "spring": "cubic-bezier(0.68, -0.55, 0.265, 1.55)" // Bounce  
 }  
}  
&#96;&#96;&#96;  

**Usage:**  
&#96;&#96;&#96;css  
/* Button hover */  
transition: background-color {duration.fast} {easing.easeOut};  

/* Modal open */  
transition: transform {duration.normal} {easing.spring};  

/* Fade in */  
transition: opacity {duration.slow} {easing.easeIn};  
&#96;&#96;&#96;  

---  

\## 9. Implementation  

\### Source File (tokens.json)  
&#96;&#96;&#96;json  
{  
 "color": {  
 "brand": {  
 "blue": {  
 "500": { "value": "#3B82F6", "type": "color" }  
 }  
 },  
 "text": {  
 "primary": { "value": "{color.gray.900}", "type": "color" }  
 }  
 },  
 "space": {  
 "4": { "value": "16px", "type": "dimension" },  
 "md": { "value": "{space.4}", "type": "dimension" }  
 },  
 "fontSize": {  
 "base": { "value": "16px", "type": "dimension" }  
 },  
 "button": {  
 "primary": {  
 "bg": { "value": "{color.brand.blue.500}", "type": "color" }  
 }  
 }  
}  
&#96;&#96;&#96;  

\### CSS Variables Output  
&#96;&#96;&#96;css  
:root {  
 /* Colors */  
 --color-brand-blue-500: #3B82F6;  
 --color-text-primary: var(--color-gray-900);  

 /* Spacing */  
 --space-4: 16px;  
 --space-md: var(--space-4);  

 /* Typography */  
 --fontSize-base: 16px;  

 /* Components */  
 --button-primary-bg: var(--color-brand-blue-500);  
}  

/* Usage in components */  
.button-primary {  
 background-color: var(--button-primary-bg);  
 padding: var(--space-2) var(--space-4);  
 font-size: var(--fontSize-base);  
}  
&#96;&#96;&#96;  

\### Platform-Specific Exports  

**iOS (Swift)**  
&#96;&#96;&#96;swift  
// Colors.swift  
enum Colors {  
 static let brandBlue500 = UIColor(hex: \"#3B82F6\")  
 static let textPrimary = UIColor(hex: \"#111827\")  
 static let buttonPrimaryBg = Colors.brandBlue500  
}  

// Spacing.swift  
enum Spacing {  
 static let space4: CGFloat = 16  
 static let md: CGFloat = space4  
}  
&#96;&#96;&#96;  

**Android (XML)**  
&#96;&#96;&#96;xml  
&lt;!-- colors.xml --&gt;  
&lt;resources&gt;  
 &lt;color name=\"color_brand_blue_500\"&gt;#3B82F6&lt;/color&gt;  
 &lt;color name=\"color_text_primary\"&gt;#111827&lt;/color&gt;  
 &lt;color name=\"button_primary_bg\"&gt;@color/color_brand_blue_500&lt;/color&gt;  
&lt;/resources&gt;  

&lt;!-- dimens.xml --&gt;  
&lt;resources&gt;  
 &lt;dimen name=\"space_4\"&gt;16dp&lt;/dimen&gt;  
 &lt;dimen name=\"space_md\"&gt;@dimen/space_4&lt;/dimen&gt;  
&lt;/resources&gt;  
&#96;&#96;&#96;  

**React Native (JavaScript)**  
&#96;&#96;&#96;javascript  
// tokens.js  
export const colors = {  
 brand: {  
 blue: {  
 500: '\1'  
 }  
 },  
 text: {  
 primary: '\1'  
 },  
 button: {  
 primary: {  
 bg: '#3B82F6' // Resolved from {color.brand.blue.500}  
 }  
 }  
};  

export const space = {  
 4: 16,  
 md: 16 // Resolved from {space.4}  
};  

// Usage in components  
import { colors, space } from './tokens';  

const buttonStyle = {  
 backgroundColor: colors.button.primary.bg,  
 paddingHorizontal: space.md  
};  
&#96;&#96;&#96;  

**Flutter (Dart)**  
&#96;&#96;&#96;dart  
// tokens.dart  
class AppColors {  
 static const brandBlue500 = Color(0xFF3B82F6);  
 static const textPrimary = Color(0xFF111827);  
 static const buttonPrimaryBg = brandBlue500;  
}  

class AppSpacing {  
 static const double space4 = 16.0;  
 static const double md = space4;  
}  
&#96;&#96;&#96;  

\### Build Pipeline (Style Dictionary)  

**config.json**  
&#96;&#96;&#96;json  
{  
 "source": [\"tokens/**/*.json\"],  
 "platforms": {  
 "css": {  
 "transformGroup\": \"css\",  
 \"buildPath\": \"build/css/\",  
 \"files\": [{  
 \"destination\": \"tokens.css\",  
 \"format\": \"css/variables\"  
 }]  
 },  
 "ios\": {  
 \"transformGroup\": \"ios\",  
 \"buildPath\": \"build/ios/\",  
 \"files\": [{  
 \"destination\": \"Tokens.swift\",  
 \"format\": \"ios-swift/class.swift\"  
 }]  
 },  
 \"android\": {  
 \"transformGroup\": \"android\",  
 \"buildPath\": \"build/android/\",  
 \"files\": [{  
 \"destination\": \"tokens.xml\",  
 \"format\": \"android/resources\"  
 }]  
 },  
 \"react-native\": {  
 \"transformGroup\": \"js\",  
 \"buildPath\": \"build/rn/\",  
 \"files\": [{  
 \"destination\": \"tokens.js\",  
 \"format\": \"javascript/es6\"  
 }]  
 }  
 }  
}  
&#96;&#96;&#96;  

**Build Command:**  
&#96;&#96;&#96;bash  
npm install style-dictionary  
style-dictionary build --config config.json  
&#96;&#96;&#96;  

---  

\## 10. Component Library  

\### Atomic Design Structure  
&#96;&#96;&#96;  
components/  
├── atoms/  
│ ├── Button/  
│ │ ├── Button.tsx  
│ │ ├── Button.styles.ts  
│ │ ├── Button.stories.tsx  
│ │ └── Button.test.tsx  
│ ├── Input/  
│ ├── Text/  
│ ├── Icon/  
│ └── Badge/  
├── molecules/  
│ ├── InputGroup/ (Input + Label + Error)  
│ ├── Card/  
│ ├── StatCard/  
│ └── SearchBar/  
├── organisms/  
│ ├── Header/  
│ ├── WorkoutCard/  
│ ├── ProfileStats/  
│ └── ActivityFeed/  
└── templates/  
 ├── DashboardLayout/  
 └── WorkoutDetailLayout/  
&#96;&#96;&#96;  

\### Button Component Example  

**Button.tsx (React)**  
&#96;&#96;&#96;typescript  
import { tokens } from '@/design-tokens';  
import { ButtonContainer } from './Button.styles';  

interface ButtonProps {  
 variant: 'primary' &#124; 'secondary' &#124; 'ghost';  
 size: 'sm' &#124; 'md' &#124; 'lg';  
 children: React.ReactNode;  
 disabled?: boolean;  
 onPress: () =&gt; void;  
}  

export const Button = ({  
 variant = 'primary',  
 size = 'md',  
 children,  
 disabled = false,  
 onPress  
}: ButtonProps) =&gt; {  
 return (  
 &lt;ButtonContainer  
 variant={variant}  
 size={size}  
 disabled={disabled}  
 onPress={onPress}  
 &gt;  
 {children}  
 &lt;/ButtonContainer&gt;  
 );  
};  
&#96;&#96;&#96;  

**Button.styles.ts (Styled Components)**  
&#96;&#96;&#96;typescript  
import styled from 'styled-components/native';  
import { tokens } from '@/design-tokens';  

interface ContainerProps {  
 variant: string;  
 size: string;  
 disabled: boolean;  
}  

export const ButtonContainer = styled.TouchableOpacity&lt;ContainerProps&gt;&#96;  
 /* Layout */  
 height: ${  
 props =&gt; props.size === 'sm' ? tokens.button.height.sm :  
 props.size === 'lg' ? tokens.button.height.lg :  
 tokens.button.height.md  
 };  
 padding-horizontal: ${  
 props =&gt; props.size === 'sm' ? tokens.button.paddingX.sm :  
 props.size === 'lg' ? tokens.button.paddingX.lg :  
 tokens.button.paddingX.md  
 };  
 border-radius: ${tokens.button.borderRadius};  

 /* Colors */  
 background-color: ${  
 props =&gt; props.disabled ? tokens.button.primary['bg-disabled'] :  
 props.variant === 'primary' ? tokens.button.primary.bg :  
 props.variant === 'secondary' ? tokens.button.secondary.bg :  
 'transparent'  
 };  

 /* Border */  
 border-width: ${  
 props =&gt; props.variant === 'secondary' ? '2px' : '0px'  
 };  
 border-color: ${  
 props =&gt; props.variant === 'secondary' ? tokens.button.secondary.border : 'transparent'  
 };  

 /* Shadow */  
 shadow-color: #000;  
 shadow-offset: 0px 1px;  
 shadow-opacity: 0.1;  
 shadow-radius: 3px;  
 elevation: 2;  

 /* Alignment */  
 justify-content: center;  
 align-items: center;  
 flex-direction: row;  
&#96;;  
&#96;&#96;&#96;  

**Button.stories.tsx (Storybook)**  
&#96;&#96;&#96;typescript  
import { Button } from './Button';  

export default {  
 title: 'Atoms/Button',  
 component: Button,  
 argTypes: {  
 variant: {  
 options: ['primary', 'secondary', 'ghost'],  
 control: { type: 'radio' }  
 },  
 size: {  
 options: ['sm', 'md', 'lg'],  
 control: { type: 'radio' }  
 }  
 }  
};  

export const Primary = () =&gt; (  
 &lt;Button variant=\"primary\" size=\"md\" onPress={() =&gt; console.log('Pressed')}&gt;  
 Start Workout  
 &lt;/Button&gt;  
);  

export const Secondary = () =&gt; (  
 &lt;Button variant=\"secondary\" size=\"md\" onPress={() =&gt; {}}&gt;  
 Cancel  
 &lt;/Button&gt;  
);  

export const Disabled = () =&gt; (  
 &lt;Button variant=\"primary\" size=\"md\" disabled onPress={() =&gt; {}}&gt;  
 Loading...  
 &lt;/Button&gt;  
);  

export const AllSizes = () =&gt; (  
 &lt;&gt;  
 &lt;Button variant=\"primary\" size=\"sm\" onPress={() =&gt; {}}&gt;Small&lt;/Button&gt;  
 &lt;Button variant=\"primary\" size=\"md\" onPress={() =&gt; {}}&gt;Medium&lt;/Button&gt;  
 &lt;Button variant=\"primary\" size=\"lg\" onPress={() =&gt; {}}&gt;Large&lt;/Button&gt;  
 &lt;/&gt;  
);  
&#96;&#96;&#96;  

\### Component API Design  

**Prop Design Principles:**  
1. **Semantic names:** &#96;variant=\"primary\"&#96; not &#96;color=\"blue\"&#96;  
2. **Predictable defaults:** Most common use case is default  
3. **Composition over configuration:** Allow children, icons, etc.  
4. **Type safety:** Use TypeScript enums/unions  

**Composition Patterns:**  
&#96;&#96;&#96;typescript  
// ✅ Good: Composable  
&lt;Button&gt;  
 &lt;Icon name=\"plus\" /&gt;  
 Add Workout  
&lt;/Button&gt;  

// ❌ Bad: Too many props  
&lt;Button   
 iconName=\"plus\"   
 iconPosition=\"left\"   
 iconSize=\"16\"  
 text=\"Add Workout\"  
/&gt;  
&#96;&#96;&#96;  

\### Storybook Documentation  

Run Storybook:  
&#96;&#96;&#96;bash  
npm run storybook  
&#96;&#96;&#96;  

Organization:  
&#96;&#96;&#96;  
- Atoms  
 - Button  
 - Primary  
 - Secondary  
 - Disabled  
 - All Sizes  
 - Input  
 - Badge  
- Molecules  
 - InputGroup  
 - Card  
- Organisms  
 - Header  
 - WorkoutCard  
&#96;&#96;&#96;  

---  

**Token System Version:** 1.0  
**Framework:** Style Dictionary  
**Last Updated:** Nov 2025  
**Maintained by:** Design Systems Team

### Kde použít tento prompt?

Najděte vhodné AI nástroje pro použití tohoto promptu a maximalizujte jeho efektivitu.

 [ 🔧 Vhodné nástroje ](https://zacinamsai.cz/tools?category=kreativn%C3%AD) [ 📖 Návody ](https://zacinamsai.cz/articles?search=Claude) [ 📚 Slovník ](https://zacinamsai.cz/glossary?search=Kreativn%C3%AD) 

### Podobné prompty

 [  

  Expert  

####  Accessibility audit a WCAG compliance 

Proveď komplexní accessibility audit s WCAG 2.1 compliance checklist a remediation plán.

  Kreativní  Zobrazit  

 ](https://zacinamsai.cz/prompts/accessibility-audit-wcag-compliance) [  

  Expert  

####  Animace a micro-interactions design 

Navrhni systém animací a micro-interactions pro aplikaci včetně timing a easing curves.

  Kreativní  Zobrazit  

 ](https://zacinamsai.cz/prompts/animace-a-micro-interactions) [  

  Expert  

####  Animační principy pro UI micro-interactions 

Navrhni micro-interakce s přesnými timing, easing funkcemi a animačními principy pro UI element.

  Kreativní  Zobrazit  

 ](https://zacinamsai.cz/prompts/animacni-principy-pro-ui-micro-interactions) [  

  Expert  

####  Architektonická vizualizace - exteriér i interiér 

Vytvoř fotorealistickou architektonickou vizualizaci s precizní specifikací osvětlení, materiálů a atmosféry.

  Kreativní  Zobrazit  

 ](https://zacinamsai.cz/prompts/architectural-visualization) 

### Objevte další AI prompty

 Prozkoumejte naši sbírku Kreativní promptů a najděte ty, které vám pomohou dosáhnout lepších výsledků.

 [ Další Kreativní prompty ](https://zacinamsai.cz/prompts?category=creative) [ Všechny prompty ](https://zacinamsai.cz/prompts)

```json
{
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "Začínám s AI",
        "alternateName": "zacinamsai.cz",
        "url": "https://zacinamsai.cz",
        "description": "Průvodce světem umělé inteligence - Katalog AI nástrojů, články, prompty a slovník pojmů",
        "inLanguage": "cs",
        "potentialAction": {
            "@type": "SearchAction",
            "target": {
                "@type": "EntryPoint",
                "urlTemplate": "https://zacinamsai.cz/search?q={search_term_string}"
            },
            "query-input": {
                "@type": "PropertyValueSpecification",
                "valueRequired": true,
                "valueName": "search_term_string"
            }
        },
        "publisher": {
            "@type": "Organization",
            "name": "Začínám s AI",
            "url": "https://zacinamsai.cz",
            "logo": {
                "@type": "ImageObject",
                "url": "https://zacinamsai.cz/images/zacinamsai_logo.png"
            }
        }
    }
```
