--- name: ui-patterns description: UI design patterns for React + TailwindCSS. Use when creating new UI components, styling elements, implementing dark mode support, or working on any React component that needs consistent styling. --- # UI Patterns ## Required: Dark Mode Support All UI components MUST support dark mode using Tailwind's `class` strategy. ```tsx // Always provide dark: variants className="bg-white dark:bg-slate-900 text-slate-900 dark:text-white" ``` ## Color System ### Brand Colors (Blue) - Primary actions - `brand-500` / `brand-600` - Primary buttons, links - `brand-100` / `dark:brand-900/30` - Highlighted backgrounds - `brand-700` / `dark:brand-300` - Text on brand backgrounds ### System Colors (Slate) - UI chrome - `slate-50` / `dark:slate-950` - Page backgrounds - `slate-100` / `dark:slate-800` - Secondary/card backgrounds - `slate-200` / `dark:slate-700` - Borders - `slate-400` - Muted text - `slate-700` / `dark:white` - Primary text ### Semantic Colors - Success: `emerald-*` (done, approved) - Warning: `amber-*` (pending, paused) - Error: `red-*` (failed, stopped) ## Component Classes Use pre-defined component classes for consistency: ```tsx // Buttons // Inputs