How To: Actually Code UI That Matches Your Mockup (React + Tailwind)
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
Analyze this web design mockup as a senior UI engineer would. Create a complete technical specification:
1. DESIGN SYSTEM TOKENS:
- Extract the color palette with semantic naming (primary, secondary, surface, text)
- Identify the type scale (heading levels, body text sizes)
- Document the spacing scale pattern (4px, 8px, 16px, etc.)
- List border radius values used consistently
2. LAYOUT ARCHITECTURE:
- Describe the overall page structure using semantic HTML5 elements
- Identify CSS Grid vs Flexbox usage for each section
3. COMPONENT SPECIFICATIONS:
For each unique component, provide:
- Semantic HTML structure
- CSS layout method
- All visual states (default, hover, focus, active, disabled)
- Exact dimensions and spacing
- Animation/transition properties
4. RESPONSIVE BEHAVIOR:
- Describe how the layout adapts (even if only desktop is shown)
- Note which elements stack, hide, or resize
- Identify touch targets that need enlarging on mobile
5. ACCESSIBILITY REQUIREMENTS:
- Color contrast ratios for text/background combinations
- Interactive element sizes (minimum 44x44px touch targets)
- Focus indicator styles
- Screen reader considerations for decorative elements
Format as a structured spec that includes both the visual description AND implementation notes. Flag any ambiguous design decisions that need clarification.
Using this design specification, build a responsive React component with Tailwind CSS:
Requirements:
- Create reusable components for each element in the spec
- Use CSS variables for the design tokens
- Implement all interactive states
- Ensure mobile-first responsive design
- Add proper semantic HTML and ARIA labels
- Include Framer Motion for any animations mentioned
- Match the spacing system exactly using Tailwind's spacing scale
Create a pixel-perfect implementation that matches the original design.
Tighten vertical spacing between header and subtext.