generic-react-design-system
travisjneuman/.claude/skills/generic-react-design-system/SKILL.md
Complete design system reference for React applications. Covers colors, typography, spacing, component patterns, glassmorphism effects, GPU-accelerated animations, and WCAG AA accessibility. Use when implementing UI, choosing colors, applying spacing, creating components, or ensuring brand consistency.
Skill99 starsChanged 7 months ago
What's in it
- React Design System
- Tailwind Configuration
- CSS Variables Setup
- React Component Patterns
- Button Variants
- Input Fields
- Cards
- Modals with Framer Motion
- Loading Skeleton
- Visual Effects
- Glassmorphism
- Shadows
- Framer Motion Patterns
- Hover Lift
- Page Transitions
- Stagger Children
- Dark Mode Implementation
- React Context Approach
- System Preference Detection
- Accessibility in React
- Focus States (Tailwind)
- Skip Link
- See Also
---
name: generic-react-design-system
description: Complete design system reference for React applications. Covers colors, typography, spacing, component patterns, glassmorphism effects, GPU-accelerated animations, and WCAG AA accessibility. Use when implementing UI, choosing colors, applying spacing, creating components, or ensuring brand consistency.
---
# React Design System
Design system patterns for React/TypeScript applications.
**Extends:** [Generic Design System](../generic-design-system/SKILL.md) - Read base skill for color theory, typography scale, spacing system, and component states.
## Tailwind Configuration
```js
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: "var(--primary)",
secondary: "var(--secondary)",
accent: "var(--accent)",
},
spacing: {
18: "72px",
},
borderRadius: {
xl: "16px",
},
},
},
};
```
### CSS Variables Setup
```css
:root {
/* Brand - customize per project */
--primary: #3b82f6;
--primary-rgb: 59, 130, 246;
--secondary: #10b981;
--accent: #8b5cf6;
/* Surfaces */
--background: #ffffff;
--foreground: #000000;
--muted: #64748b;
}
[data-theme="dark"] {
--background: #121212;
--foreground: #ffffff;
}
```
## React Component Patterns
### Button Variants
```tsx
// Primary
<button className="px-6 py-3 bg-primary text-white rounded-lg shadow
hover:shadow-lg hover:-translate-y-0.5 transition-all">
Primary
</button>
// Secondary
<button className="px-6 py-3 border border-primary text-primary rounded-lg
hover:bg-primary/10 transition-all">
Secondary
</button>
// Ghost
<button className="px-4 py-2 text-muted hover:bg-slate-100 rounded-lg transition-all">
Ghost
</button>
```
### Input Fields
```tsx
<input
className="w-full px-4 py-3 bg-white border border-slate-300 rounded-md
focus:border-primary focus:ring-2 focus:ring-primary/50 transition-all"
placeholder="Enter text..."
/>
```
### Cards
```tsx
<div className="p-6 bg-white dark:bg-slate-800 rounded-xl shadow-soft">
{/* Card content */}
</div>
```
### Modals with Framer Motion
```tsx
<motion.div
initial={{ opacity: 0, scale: 0.95 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.95 }}
className="glass p-8 rounded-2xl max-w-md"
role="dialog"
aria-modal="true"
>
{/* Modal content */}
</motion.div>
```
### Loading Skeleton
```tsx
<div className="animate-pulse space-y-4">
<div className="h-8 bg-slate-200 dark:bg-slate-700 rounded w-3/4" />
<div className="h-4 bg-slate-200 dark:bg-slate-700 rounded" />
</div>
```
## Visual Effects
### Glassmorphism
```css
.glass {
backdrop-filter: blur(12px) saturate(180%);
background: rgba(255, 255, 255, 0.8);
border: 1px solid rgba(148, 163, 184, 0.25);
}
.glass-dark {
background: rgba(255, 255, 255, 0.05);
}
```
### Shadows
```css
--shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-medium: 0 10px 15px rgba(0, 0, 0, 0.15);
--shadow-floating: 0 25px 50px rgba(0, 0, 0, 0.3);
--shadow-glow: 0 0 20px rgba(var(--primary-rgb), 0.4);
```
## Framer Motion Patterns
### Hover Lift
```tsx
<motion.div
whileHover={{ y: -4 }}
transition={{ type: "spring", stiffness: 300 }}
className="card"
>
{/* Content */}
</motion.div>
```
### Page Transitions
```tsx
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
transition={{ duration: 0.2 }}
>
{/* Page content */}
</motion.div>
```
### Stagger Children
```tsx
const container = {
hidden: { opacity: 0 },
show: {
opacity: 1,
transition: { staggerChildren: 0.1 },
},
};
const item = {
hidden: { opacity: 0, y: 20 },
show: { opacity: 1, y: 0 },
};
<motion.ul variants={container} initial="hidden" animate="show">
{items.map((i) => (
<motion.li key={i} variants={item} />
))}
</motion.ul>;
```
## Dark Mode Implementation
### React Context Approach
```tsx
// ThemeProvider.tsx
const ThemeContext = createContext<{
theme: "light" | "dark";
toggle: () => void;
}>({ theme: "light", toggle: () => {} });
export function ThemeProvider({ children }: { children: ReactNode }) {
const [theme, setTheme] = useState<"light" | "dark">("light");
useEffect(() => {
document.documentElement.dataset.theme = theme;
}, [theme]);
return (
<ThemeContext.Provider
value={{
theme,
toggle: () => setTheme((t) => (t === "light" ? "dark" : "light")),
}}
>
{children}
</ThemeContext.Provider>
);
}
```
### System Preference Detection
```tsx
useEffect(() => {
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
setTheme(prefersDark.matches ? "dark" : "light");
prefersDark.addEventListener("change", (e) =>
setTheme(e.matches ? "dark" : "light"),
);
}, []);
```
## Accessibility in React
### Focus States (Tailwind)
```css
*:focus-visible {
@apply outline-2 outline-primary outline-offset-2;
}
```
### Skip Link
```tsx
<a
href="#main"
className="sr-only focus:not-sr-only focus:absolute
focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-2
focus:bg-primary focus:text-white focus:rounded"
>
Skip to content
</a>
```
## See Also
- [Generic Design System](../generic-design-system/SKILL.md) - Tokens, spacing, typography
- [Design Patterns](../_shared/DESIGN_PATTERNS.md) - Atomic Design, component docs
- [UX Principles](../_shared/UX_PRINCIPLES.md) - Visual hierarchy, interaction patterns
More agent context in travisjneuman/.claude
127 other files this repository gives its agents, the first 60 shown.
CLAUDE.md
Skill
- accessibility-a11yskills/accessibility-a11y/SKILL.md
- agent-teamsskills/agent-teams/SKILL.md
- ai-ml-developmentskills/ai-ml-development/SKILL.md
- ai-policy-generatorskills/ai-policy-generator/SKILL.md
- android-developmentskills/android-development/SKILL.md
- api-designskills/api-design/SKILL.md
- application-securityskills/application-security/SKILL.md
- ar-vr-xrskills/ar-vr-xr/SKILL.md
- audio-productionskills/audio-production/SKILL.md
- authentication-patternsskills/authentication-patterns/SKILL.md
- auto-claudeskills/auto-claude/SKILL.md
- battle-card-builderskills/battle-card-builder/SKILL.md
- blockchain-web3skills/blockchain-web3/SKILL.md
- brand-identityskills/brand-identity/SKILL.md
- business-strategyskills/business-strategy/SKILL.md
- career-path-plannerskills/career-path-planner/SKILL.md
- case-interview-practiceskills/case-interview-practice/SKILL.md
- codebase-documenterskills/codebase-documenter/SKILL.md
- compliance-engineeringskills/compliance-engineering/SKILL.md
- content-repurposerskills/content-repurposer/SKILL.md
- contract-redlinerskills/contract-redliner/SKILL.md
- core-workflowskills/core-workflow/SKILL.md
- course-material-creatorskills/course-material-creator/SKILL.md
- customer-persona-builderskills/customer-persona-builder/SKILL.md
- customer-successskills/customer-success/SKILL.md
- database-expertskills/database-expert/SKILL.md
- data-engineeringskills/data-engineering/SKILL.md
- data-scienceskills/data-science/SKILL.md
- debate-practice-coachskills/debate-practice-coach/SKILL.md
- debug-systematicskills/debug-systematic/SKILL.md
- devex-sdk-designskills/devex-sdk-design/SKILL.md
- devops-cloudskills/devops-cloud/SKILL.md
- docxskills/document-skills/docx/SKILL.md
- pdfskills/document-skills/pdf/SKILL.md
- pptxskills/document-skills/pptx/SKILL.md
- document-skillsskills/document-skills/SKILL.md
- xlsxskills/document-skills/xlsx/SKILL.md
- edge-computingskills/edge-computing/SKILL.md
- electron-desktopskills/electron-desktop/SKILL.md
- email-systemsskills/email-systems/SKILL.md
- embedded-iotskills/embedded-iot/SKILL.md
- event-driven-architectureskills/event-driven-architecture/SKILL.md
- event-plannerskills/event-planner/SKILL.md
- financeskills/finance/SKILL.md
- financial-scenario-plannerskills/financial-scenario-planner/SKILL.md
- flutter-developmentskills/flutter-development/SKILL.md
- frontend-enhancerskills/frontend-enhancer/SKILL.md
- fundraising-analyzerskills/fundraising-analyzer/SKILL.md
- game-developmentskills/game-development/SKILL.md
- generic-code-reviewerskills/generic-code-reviewer/SKILL.md
- generic-design-systemskills/generic-design-system/SKILL.md
- generic-feature-developerskills/generic-feature-developer/SKILL.md
- generic-fullstack-code-reviewerskills/generic-fullstack-code-reviewer/SKILL.md
- generic-fullstack-design-systemskills/generic-fullstack-design-system/SKILL.md
- generic-fullstack-feature-developerskills/generic-fullstack-feature-developer/SKILL.md
- generic-fullstack-ux-designerskills/generic-fullstack-ux-designer/SKILL.md
- generic-react-code-reviewerskills/generic-react-code-reviewer/SKILL.md
- generic-react-feature-developerskills/generic-react-feature-developer/SKILL.md
- generic-react-ux-designerskills/generic-react-ux-designer/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

