# IGNY8 Design Standard Reference
**Standardized UI patterns used across Planner, Writer, and Dashboard modules**
This document defines the locked design patterns and component usage standards for the IGNY8 application. All modules (including Sites) should follow these patterns to maintain visual consistency.
---
## Core Component Library
### 1. Button Component
**Location:** `frontend/src/components/ui/button/Button.tsx`
**Status:** 🔒 STYLE LOCKED - See `DESIGN_SYSTEM.md`
#### Variants (5 total)
- `solid` - Filled background (primary action)
- `soft` - Light background (secondary action)
- `outline` - Border only (tertiary action)
- `ghost` - No border or background (minimal action)
- `gradient` - Gradient background with shadow (premium/highlight action)
#### Sizes (4 total)
- `xs` - Extra small
- `sm` - Small
- `md` - Medium (default)
- `lg` - Large
#### Tones (5 total)
- `brand` - Primary brand color (blue)
- `success` - Green
- `warning` - Orange
- `danger` - Red/Error
- `neutral` - Gray
#### Usage Example
```tsx
import Button from '../../components/ui/button/Button';
}>
Click Me
```
#### ⚠️ Anti-Pattern
```tsx
// ❌ DON'T: Raw HTML buttons with inline Tailwind
// ✅ DO: Use Button component
```
---
### 2. ComponentCard
**Location:** `frontend/src/components/common/ComponentCard.tsx`
**Purpose:** Standard card wrapper for sections with title and description
#### Props
- `title` (required) - Section title (string or ReactNode)
- `desc` (optional) - Description text below title
- `children` (required) - Card content
- `className` (optional) - Additional styling
#### Usage Example
```tsx
import ComponentCard from '../../components/common/ComponentCard';
{/* Content */}
```
#### Structure
- **Header:** Title + optional description (gray text)
- **Body:** Border-top separated content area with padding
- **Dark mode:** Automatic theme support
#### ⚠️ Anti-Pattern
```tsx
// ❌ DON'T: Raw Card component with manual header
Quick Actions
{/* Content */}
// ✅ DO: Use ComponentCard
{/* Content */}
```
---
### 3. EnhancedMetricCard
**Location:** `frontend/src/components/dashboard/EnhancedMetricCard.tsx`
**Purpose:** Display metrics with optional trends, tooltips, and navigation
#### Key Props
- `title` (required) - Metric label
- `value` (required) - Main metric value (string | number)
- `subtitle` (optional) - Additional context below value
- `icon` (optional) - Icon component
- `accentColor` (required) - Border accent color
- `trend` (optional) - { direction: 'up' | 'down', value: string }
- `href` (optional) - React Router navigation path
- `onClick` (optional) - Click handler (alternative to href)
- `tooltip` (optional) - Tooltip text on hover
- `details` (optional) - Array of tooltip detail breakdowns
#### Accent Colors (6 total)
- `blue` - Primary/default metrics
- `green` - Success/positive metrics
- `orange` - Warning/attention metrics
- `purple` - Special/premium metrics
- `red` - Error/critical metrics
- `success` - Alternative green (var(--color-success))
#### Usage Example
```tsx
import EnhancedMetricCard from '../../components/dashboard/EnhancedMetricCard';
}
accentColor="blue"
trend={{ direction: 'up', value: '+12%' }}
href="/planner/keywords"
tooltip="View all active keywords"
details={[
{ label: 'Tracked', value: '800' },
{ label: 'Untracked', value: '434' },
]}
/>
```
#### Features
- Automatic Link wrapping when `href` provided
- Hover effects and transitions
- Dark mode support
- Tooltip with optional details breakdown
- Trend indicators with arrows
#### ⚠️ Anti-Pattern
```tsx
// ❌ DON'T: Custom metric cards with inline styles
Active Keywords
1,234
// ✅ DO: Use EnhancedMetricCard
}
accentColor="blue"
/>
```
---
### 4. PageHeader
**Location:** `frontend/src/components/common/PageHeader.tsx`
**Purpose:** Standardized page header with title, site/sector info, and selectors
#### Key Props
- `title` (required) - Page title
- `lastUpdated` (optional) - Last refresh timestamp
- `badge` (optional) - { icon: ReactNode, color: 'blue' | 'green' | ... }
- `showRefresh` (optional) - Show refresh button
- `onRefresh` (optional) - Refresh button handler
- `hideSiteSector` (optional) - Hide site/sector info for global pages
- `className` (optional) - Additional styling
#### Badge Colors (6 total)
Same as Button/Metric: `blue`, `green`, `purple`, `orange`, `red`, `indigo`
#### Usage Example
```tsx
import PageHeader from '../../components/common/PageHeader';
import { ListIcon } from '../../icons';
, color: 'blue' }}
showRefresh={true}
onRefresh={handleRefresh}
/>
```
#### Features
- Automatic site/sector display from stores
- SiteAndSectorSelector integration
- Responsive layout (stack on mobile)
- Badge with icon support
- Last updated timestamp
#### ⚠️ Anti-Pattern
```tsx
// ❌ DON'T: Custom page headers with manual layout
Keyword Dashboard
Site: {site.name} • Sector: {sector.name}
// ✅ DO: Use PageHeader
```
---
### 5. Link Component (React Router)
**Location:** `react-router-dom`
**Purpose:** Standard navigation with automatic prefetching and accessibility
#### Usage Example
```tsx
import { Link } from 'react-router-dom';