# Quick Start Guide Get up and running with the PragmaStack design system immediately. This guide covers the essential patterns you need to build 80% of interfaces. --- ## TL;DR ```tsx // 1. Import from @/components/ui/* import { Button } from '@/components/ui/button'; import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'; // 2. Use semantic color tokens className="bg-primary text-primary-foreground" className="text-destructive" // 3. Use spacing scale (4, 8, 12, 16, 24, 32...) className="p-4 space-y-6" // 4. Build layouts with these patterns
{/* Your content */}
``` --- ## 1. Essential Components ### Buttons ```tsx import { Button } from '@/components/ui/button'; // Primary action // Danger action // Secondary action // Subtle action // Sizes ``` **[See all button variants](/dev/components#button)** --- ### Cards ```tsx import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from '@/components/ui/card'; User Profile Manage your account settings

Card content goes here

; ``` **[See card examples](/dev/components#card)** --- ### Forms ```tsx import { Label } from '@/components/ui/label'; import { Input } from '@/components/ui/input';
{errors.email &&

{errors.email.message}

}
; ``` **[See form patterns](./06-forms.md)** | **[Form examples](/dev/forms)** --- ### Dialogs/Modals ```tsx import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogTrigger, } from '@/components/ui/dialog'; Confirm Action Are you sure you want to proceed? ; ``` **[See dialog examples](/dev/components#dialog)** --- ### Alerts ```tsx import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; import { AlertCircle } from 'lucide-react'; // Default alert Heads up! This is an informational message. // Error alert Error Something went wrong. Please try again. ``` **[See all component variants](/dev/components)** --- ## 2. Essential Layouts (1 minute) ### Page Container ```tsx // Standard page layout

Page Title

{/* Content */}
``` ### Dashboard Grid ```tsx // Responsive card grid
{items.map((item) => ( {item.title} {item.content} ))}
``` ### Form Layout ```tsx // Centered form with max width
Login
{/* Form fields */}
``` **[See all layout patterns](./03-layouts.md)** | **[Layout examples](/dev/layouts)** --- ## 3. Color System **Always use semantic tokens**, never arbitrary colors: ```tsx // ✅ GOOD - Semantic tokens
Primary
Error
Disabled

Body text

Secondary text

// ❌ BAD - Arbitrary colors
Don't do this
``` **Available tokens:** - `primary` - Main brand color, CTAs - `destructive` - Errors, delete actions - `muted` - Disabled states, subtle backgrounds - `accent` - Hover states, highlights - `foreground` - Body text - `muted-foreground` - Secondary text - `border` - Borders, dividers **[See complete color system](./01-foundations.md#color-system-oklch)** --- ## 4. Spacing System **Use multiples of 4** (Tailwind's base unit is 0.25rem = 4px): ```tsx // ✅ GOOD - Consistent spacing
Content
// ❌ BAD - Arbitrary spacing
Content
``` **Common spacing values:** - `2` (8px) - Tight spacing - `4` (16px) - Standard spacing - `6` (24px) - Section spacing - `8` (32px) - Large gaps - `12` (48px) - Section dividers **Pro tip:** Use `gap-` for grids/flex, `space-y-` for vertical stacks: ```tsx // Grid spacing
// Stack spacing
``` **[Read spacing philosophy](./04-spacing-philosophy.md)** --- ## 5. Responsive Design **Mobile-first approach** with Tailwind breakpoints: ```tsx

Responsive Title

// Grid columns
``` **Breakpoints:** - `sm:` 640px+ - `md:` 768px+ - `lg:` 1024px+ - `xl:` 1280px+ --- ## 6. Accessibility **Always include:** ```tsx // Labels for inputs // ARIA for errors {errors.email && (

{errors.email.message}

)} // ARIA labels for icon-only buttons ``` **[Complete accessibility guide](./07-accessibility.md)** --- ## 7. Common Patterns Cheat Sheet ### Loading State ```tsx import { Skeleton } from '@/components/ui/skeleton'; { isLoading ? :
{content}
; } ``` ### Dropdown Menu ```tsx import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; Edit Delete ; ``` ### Badge/Tag ```tsx import { Badge } from '@/components/ui/badge'; New Urgent Draft ``` --- ## 8. Next Steps You now know enough to build most interfaces! For deeper knowledge: ### Learn More - **Components**: [Complete component guide](./02-components.md) - **Layouts**: [Layout patterns](./03-layouts.md) - **Forms**: [Form patterns & validation](./06-forms.md) - **Custom Components**: [Component creation guide](./05-component-creation.md) ### Interactive Examples - **[Component Showcase](/dev/components)** - All components with code - **[Layout Examples](/dev/layouts)** - Before/after comparisons - **[Form Examples](/dev/forms)** - Complete form implementations ### Reference - **[Quick Reference Tables](./99-reference.md)** - Bookmark this for lookups - **[Foundations](./01-foundations.md)** - Complete color/spacing/typography guide --- ## 🎯 Golden Rules Remember these and you'll be 95% compliant: 1. ✅ **Import from `@/components/ui/*`** 2. ✅ **Use semantic colors**: `bg-primary`, not `bg-blue-500` 3. ✅ **Use spacing scale**: 4, 8, 12, 16, 24, 32 (multiples of 4) 4. ✅ **Use `cn()` for className merging**: `cn("base", conditional && "extra", className)` 5. ✅ **Add accessibility**: Labels, ARIA, keyboard support 6. ✅ **Test in dark mode**: Toggle with theme switcher --- ## 🚀 Start Building! You're ready to build. When you hit edge cases or need advanced patterns, refer back to the [full documentation](./README.md). **Bookmark these:** - [Quick Reference](./99-reference.md) - For quick lookups - [AI Guidelines](./08-ai-guidelines.md) - If using AI assistants - [Component Showcase](/dev/components) - For copy-paste examples Happy coding! 🎨