--- name: component-recipes description: Tailwind CSS component recipes. Use when building UI components with consistent styling. Provides copy-paste patterns for cards, badges, buttons, modals, inputs, and more. --- # Component Recipes ## Overview Ready-to-use Tailwind CSS patterns for demo components. ## Card Recipes ### Basic Card ```tsx
{children}
``` ### Clickable Card ```tsx ``` ### Selected Card ```tsx
{children}
``` ## Badge Recipes ### Severity Badges ```tsx // Safety Hazard {label} // Repair Needed {label} // Maintenance Item {label} // Monitor {label} // Informational {label} ``` ### Condition Badges ```tsx // Excellent {label} // Good {label} // Fair / Poor (use yellow-100/orange-100) ``` ### Badge Sizes ```tsx // Small className="px-2 py-0.5 text-xs" // Medium (default) className="px-2.5 py-0.5 text-xs" // Large className="px-3 py-1 text-sm" ``` ## Button Recipes ### Primary Button ```tsx ``` ### Secondary Button ```tsx ``` ### Ghost Button ```tsx ``` ### Icon Button ```tsx ``` ## Modal Recipes ### Modal Overlay ```tsx
``` ### Modal Content ```tsx
{children}
``` ### Modal Header ```tsx

{title}

``` ## Input Recipes ### Text Input ```tsx ``` ### Input with Error ```tsx

{errorMessage}

``` ## Progress Recipes ### Progress Bar ```tsx
``` ### Colored Progress (Condition-based) ```tsx // className based on condition const progressColor = { excellent: 'bg-green-500', good: 'bg-lime-500', fair: 'bg-yellow-500', poor: 'bg-orange-500', }[condition]; ``` ## Layout Recipes ### Page Container ```tsx
{children}
``` ### Card Grid ```tsx
{items.map(item => )}
``` ### Section Header ```tsx

{title}

{actions}
``` ## Best Practices - Use semantic color tokens (brand-primary, severity-*, condition-*) - Maintain consistent spacing (4px grid) - Include focus states for accessibility - Use transition classes for smooth interactions ## Anti-Patterns - NO hardcoded hex colors - NO inconsistent border-radius - NO missing focus states - NO arbitrary spacing values