# Fakemui Migration Guide
Guide for migrating from custom CSS, Tailwind, or other UI libraries to Fakemui.
## Why Migrate to Fakemui?
| Benefit | Impact |
|---------|--------|
| **Consistency** | Unified Material Design 3 across all projects |
| **Development Speed** | Pre-built components reduce custom CSS by ~90% |
| **Accessibility** | WCAG AA+ compliance built-in |
| **Type Safety** | Full TypeScript support for all components |
| **Maintainability** | Shared component library across team |
| **Performance** | Optimized rendering and bundle size |
| **Theming** | 9 built-in themes + custom theme support |
## Migration Strategies
### Strategy 1: Incremental Component Replacement (Recommended)
Replace components one by one while keeping existing code working:
**Step 1: Add Fakemui to your project**
```bash
# Already available in MetaBuilder monorepo
import { Button, Card } from '@/fakemui'
```
**Step 2: Replace one component at a time**
Before (Custom CSS):
```tsx
import './styles.css'
export function MyComponent() {
return (
Title
)
}
/* styles.css */
.card {
border: 1px solid #ddd;
border-radius: 8px;
padding: 16px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.card-title {
font-size: 20px;
font-weight: 600;
margin: 0 0 12px 0;
}
.btn {
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
}
.btn-primary {
background-color: #1976d2;
color: white;
}
```
After (Fakemui):
```tsx
import { Card, Typography, Button } from '@/fakemui'
export function MyComponent() {
return (
Title
)
}
```
**Benefits**:
- No breaking changes
- Can test each replacement
- Gradual team adoption
- Rollback if needed
### Strategy 2: Page-by-Page Replacement
Rewrite entire pages to use Fakemui:
**Step 1: Pick a new page or low-traffic page**
```tsx
// pages/settings.tsx - Less critical, good for testing
```
**Step 2: Rewrite using Fakemui**
```tsx
import { Box, TextField, Button, Card, Stack, Typography } from '@/fakemui'
export function SettingsPage() {
return (
Settings
)
}
```
**Step 3: Move to production, gather feedback**
**Step 4: Migrate next page**
**Benefits**:
- Clear scope boundaries
- Easy to compare before/after
- Easier testing and review
### Strategy 3: New Features Only
Use Fakemui exclusively for new features:
```tsx
// Old code with custom CSS (leave as-is)
...
// New features use Fakemui
import { Dialog, Button } from '@/fakemui'
export function NewFeatureDialog() {
return
}
```
**Benefits**:
- Zero risk to existing code
- Natural migration over time
- Team learns Fakemui gradually
## Common Migration Patterns
### Pattern 1: Layout (Flexbox/Grid)
**Before (Tailwind)**:
```tsx