Backend ui-design-system
Enforce modern dashboard UI patterns with pill-shaped design, professional colour scheme, and typography standards. Use when building or reviewing UI components for the web application.
install
source · Clone the upstream repo
git clone https://github.com/sgcarstrends/sgcarstrends
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/sgcarstrends/sgcarstrends "$T" && mkdir -p ~/.claude/skills && cp -r "$T/apps/web/.claude/skills/ui-design-system" ~/.claude/skills/sgcarstrends-backend-ui-design-system && rm -rf "$T"
manifest:
apps/web/.claude/skills/ui-design-system/SKILL.mdsource content
UI Design System Skill
This skill enforces consistent UI patterns across the SG Cars Trends web application, ensuring a modern, professional dashboard design.
When to Activate
- Building new dashboard components or pages
- Reviewing existing UI for consistency
- Implementing navigation, cards, buttons, or metrics displays
- Applying colour scheme or typography
- Creating new features that require UI components
- Migrating or refactoring existing components
Design Principles
- No sidebar - Horizontal pill navigation only
- Pill-shaped elements - Use
for interactive elementsrounded-full - Large rounded cards - Use
orrounded-2xlrounded-3xl - Professional automotive aesthetic - Navy Blue primary, clean typography
- Generous whitespace - Grid-based layouts with
orgap-6gap-8
Colour Palette (GitHub Issue #406)
| Role | Colour | Hex | Tailwind Class |
|---|---|---|---|
| Primary | Navy Blue | | , |
| Secondary | Slate Gray | | , |
| Accent | Cyan | | , |
| Background | Powder Blue | | |
| Text | Dark Slate Gray | | |
Semantic Colour Usage
/text-primary
- Brand elements, primary buttonsbg-primary
- Body text (Dark Slate Gray)text-foreground
- Strong emphasis (H4 headings)text-default-900
- Secondary text (TextSm)text-default-600
- Captions, metadatatext-muted-foreground
Opacity Scale
- Secondary texttext-foreground/60
- Muted texttext-foreground/40
- Only for image overlaystext-white
Component Patterns
Navigation (Horizontal Pill Tabs)
<div className="flex items-center gap-2 rounded-full border p-1"> <Button className="rounded-full" color="primary">Dashboard</Button> <Button className="rounded-full" variant="light">Calendar</Button> <Button className="rounded-full" variant="light">Projects</Button> </div>
Cards
import { Card, CardHeader, CardBody } from "@heroui/card"; import Typography from "@web/components/typography"; <Card className="rounded-2xl shadow-sm"> <CardHeader className="flex flex-col items-start gap-2"> <Typography.H4>Card Title</Typography.H4> <Typography.TextSm>Description text</Typography.TextSm> </CardHeader> <CardBody>{/* Content */}</CardBody> </Card>
Buttons
- Primary:
<Button className="rounded-full" color="primary">Action</Button> - Secondary:
<Button className="rounded-full" variant="bordered">Cancel</Button> - Icon:
<Button className="rounded-full" isIconOnly><Icon /></Button>
Status Badges
<Chip className="rounded-full" color="success" size="sm"> <span className="mr-1">●</span> Done </Chip> <Chip className="rounded-full" color="warning" size="sm"> <span className="mr-1">●</span> Waiting </Chip> <Chip className="rounded-full" color="danger" size="sm"> <span className="mr-1">●</span> Failed </Chip>
Metrics Display
<div className="flex flex-col gap-1"> <Typography.Caption>Total Registrations</Typography.Caption> <div className="flex items-baseline gap-2"> <span className="font-bold text-3xl">46,500</span> <Chip className="rounded-full" color="success" size="sm">+2.5%</Chip> </div> </div>
Typography Rules
Always use Typography components from
@web/components/typography:
| Component | Usage | Styles |
|---|---|---|
| Page titles | |
| Section titles | |
| Subsection titles | |
| Card titles | |
| Lead paragraphs | |
| Body text | |
| Secondary text | |
| Form labels | |
| Metadata | |
Enforcement Rules
- ✅ Always use
for CardHeader titlesTypography.H4 - ✅ Always use
for CardHeader descriptionsTypography.TextSm - ✅ Use
for section headingsTypography.H2 - ❌ Avoid raw
,<h1>
,<h2>
,<h3>
tags outside MDX content<h4> - ⚠️ Exception: Raw tags allowed for MDX blog content and image overlays
Layout Guidelines
Spacing
- Use
for vertical spacing (notflex flex-col gap-*
)space-y-* - Standard gaps:
,gap-2
,gap-4
,gap-6gap-8 - Avoid
for sibling spacingmargin-top
Grid Layouts
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> <Card className="rounded-2xl">{/* ... */}</Card> <Card className="rounded-2xl">{/* ... */}</Card> <Card className="rounded-2xl">{/* ... */}</Card> </div>
Anti-Patterns (What NOT to Do)
Navigation
- ❌ Vertical sidebar navigation
- ❌ Square/rectangular tabs
- ❌ Dropdown-only navigation
Cards
- ❌ Sharp corners (
,rounded-none
)rounded-sm - ❌ Heavy shadows (
,shadow-lg
)shadow-xl - ❌ Raw
tags in CardHeader<h3>
Buttons
- ❌ Square buttons (
,rounded-none
)rounded-md - ❌ Hardcoded colours (
)bg-blue-500 - ❌ Missing hover states
Colours
- ❌ Hardcoded hex values in components
- ❌
outside image overlaystext-white - ❌ Inconsistent opacity values
Spacing
- ❌
utilitiesspace-y-* - ❌
for sibling spacingmt-* - ❌ Odd gap values (
,gap-3
,gap-5
)gap-7
Tools Used
- Read: Examine existing component implementations
- Grep: Find similar patterns in codebase
- Context7 MCP: Fetch latest HeroUI documentation
- Find library IDmcp__context7__resolve-library-id
- Get component docsmcp__context7__get-library-docs
Accessibility Requirements (WCAG AA)
- Normal text: Minimum 4.5:1 contrast ratio
- Large text: Minimum 3:1 contrast ratio
- Interactive elements: Minimum 3:1 for focus indicators
- Information must not be conveyed by colour alone
- All interactive elements must be keyboard accessible
Related Documentation
- Full UI guidelinesapps/web/CLAUDE.md- GitHub Issue #406 - Colour scheme specification
- HeroUI documentation - Component API reference