UI Analyzer
This skill provides a systematic approach to analyzing UI design screenshots and translating them into production-ready React components using TypeScript and Tailwind CSS.
Purpose
Transform UI design screenshots into well-structured, accessible, and maintainable React components. The skill guides through analyzing layouts, extracting design tokens, identifying components, and generating clean code that matches the design while following best practices.
When to Use This Skill
Use this skill when:
- The user provides a UI design screenshot, mockup, or Figma export
- The user requests "implement this design" or "build this UI"
- The user asks to "analyze this screenshot"
- The user wants to convert a design to code
- The user needs help understanding a UI's structure
- The user requests matching an existing design
Analysis Workflow
Follow these steps systematically when analyzing a UI screenshot:
Step 1: Initial Observation and Screenshot Reading
Read the provided screenshot first using the Read tool if a file path is provided, or if the user has shared an image in the conversation.
After viewing the screenshot:
- Describe what you see in the UI
- Identify the screen/page type (login, dashboard, form, etc.)
- Determine the target device (desktop, mobile, responsive)
- Note the overall aesthetic (modern, minimal, colorful, etc.)
- Confirm understanding with the user before proceeding
Step 2: Layout Analysis
Identify the high-level layout structure:
Main layout type - Consult references/layout-patterns.md to identify:
- Single column
- Sidebar layout
- Header + content
- Grid layout
- Split screen
- Dashboard
- Master-detail
- Other patterns
Layout hierarchy - Break down into sections:
- Header/navigation
- Main content area
- Sidebar (if present)
- Footer (if present)
- Nested structures
Responsive considerations:
- How should layout adapt to mobile?
- Which elements stack or hide?
- Breakpoint strategy
Reference references/layout-patterns.md for Tailwind implementation patterns.
Step 3: Component Identification
Systematically identify all UI components using references/ui-analysis-checklist.md:
Navigation Components:
- Top nav, sidebar nav, breadcrumbs, tabs, etc.
Data Display Components:
- Cards, tables, lists, stats, badges, avatars, icons, etc.
Input Components:
- Text inputs, selects, checkboxes, radios, switches, date pickers, etc.
Action Components:
- Buttons (primary, secondary, etc.), icon buttons, links, etc.
Feedback Components:
- Alerts, toasts, progress bars, loading states, etc.
Overlay Components:
- Modals, drawers, tooltips, popovers, dropdowns, etc.
List all identified components with:
- Component type and purpose
- Location in the layout
- Approximate size and styling
- Interactive states (if visible)
Step 4: Design Token Extraction
Extract design system values using references/design-tokens.md:
Color Palette:
- Identify all unique colors in the design
- Categorize by usage:
- Primary brand color
- Secondary/accent colors
- Background colors (main, secondary)
- Text colors (primary, secondary, muted)
- Border colors
- State colors (success, warning, error, info)
- Map each color to nearest Tailwind color or note custom color needed
- Create a color reference table
Typography:
- Identify font family (serif, sans-serif, monospace)
- List all text sizes observed
- Map to Tailwind typography scale (
text-xs to text-6xl)
- Note font weights used (normal, medium, semibold, bold)
- Identify heading hierarchy (H1-H6)
Spacing:
- Observe padding patterns (card padding, button padding, etc.)
- Observe margin/gap patterns (between sections, between items)
- Map to Tailwind spacing scale (p-4, m-6, gap-8, etc.)
- Note the spacing unit (usually 4px or 8px base)
Other Tokens:
- Border radius (rounded-none to rounded-full)
- Shadows (shadow-sm to shadow-2xl)
- Border widths
- Icon sizes
Reference references/design-tokens.md for complete mapping tables.
Step 5: Detailed Component Analysis
For each major component identified:
- Component boundaries - Where does it start/end?
- Props/data - What data does it receive?
- Internal structure - Sub-components and elements
- Styling details:
- Background color
- Text color and size
- Padding and margins
- Border and radius
- Shadow
- Interactive states (if visible or inferable):
- Hover
- Active/pressed
- Focused
- Disabled
- Loading
- Error
- Accessibility needs:
- ARIA labels
- Semantic HTML
- Keyboard navigation
Step 6: Implementation Strategy
Plan the implementation approach:
- Component hierarchy - Which components to build first?
- Reusability - Which patterns repeat? Extract to reusable components
- State management - Does any component need Zustand or just local state?
- Integration with react-component-generator - Can existing templates be used?
- File structure - Where should components live?
If the react-component-generator skill is available:
- Reference its templates for common components (forms, cards, buttons, modals, etc.)
- Use its best practices for component structure
- Follow its naming conventions
Step 7: Code Generation
Generate React components following these principles:
Structure:
- Start with TypeScript interfaces for props
- Use functional components with React.FC
- Include JSDoc comments
- Export both named and default exports
Styling:
- Use Tailwind CSS exclusively for styling
- Apply extracted design tokens
- Organize classes logically (layout → spacing → colors → effects → states)
- Use responsive classes where needed (sm:, md:, lg:, xl:)
Best Practices:
- Use semantic HTML elements
- Include ARIA attributes for accessibility
- Handle loading and error states
- Support keyboard navigation
- Use proper TypeScript types (no
any)
- Keep components focused and composable
Example Component Template:
import React from 'react';
interface ComponentNameProps {
// Props based on analysis
title: string;
description?: string;
onClick?: () => void;
className?: string;
}
/**
* ComponentName - Brief description based on UI purpose
*
* @param props - Component props
* @returns JSX.Element
*/
export const ComponentName: React.FC<ComponentNameProps> = ({
title,
description,
onClick,
className = ''
}) => {
return (
<div className={`/* Tailwind classes from design */ ${className}`}>
{/* Implementation based on screenshot */}
</div>
);
};
export default ComponentName;
Step 8: Verification and Refinement
After generating code:
- Review against screenshot - Does it match the design?
- Check responsiveness - Will it work on different screen sizes?
- Verify accessibility - Are ARIA labels and semantic HTML present?
- Validate design tokens - Are colors, spacing, typography correct?
- Consider edge cases - Long text, empty states, loading states
- Note assumptions - Clearly state what was assumed vs confirmed
Step 9: Deliverables
Provide the user with:
Analysis Summary:
- Layout description
- Component breakdown
- Design tokens extracted
Generated Code:
- Complete React component(s)
- TypeScript interfaces
- Tailwind classes applied
Implementation Notes:
- Installation requirements (if any packages needed)
- Usage examples
- Customization suggestions
- Responsive behavior notes
Next Steps:
- Suggest improvements or variations
- Note areas that might need refinement
- Offer to generate additional related components
Common Scenarios
Scenario 1: Simple Form Screenshot
User: "Implement this login form design [screenshot]"
Approach:
- Read screenshot
- Identify: Centered card layout with form inputs and button
- Extract: Colors, input styling, button styling, spacing
- Reference
layout-patterns.md → "Centered Modal/Card" pattern
- Reference
react-component-generator → FormComponent template
- Generate: LoginForm.tsx with proper validation structure
- Apply Tailwind classes matching the design
Scenario 2: Dashboard Screenshot
User: "Build this dashboard UI [screenshot]"
Approach:
- Read screenshot
- Identify: Header + sidebar layout with grid of stat cards
- Break down into components:
- Header component
- Sidebar navigation
- StatCard component (repeated)
- Main dashboard layout
- Extract design tokens for consistency
- Reference
layout-patterns.md → "Dashboard Layout" pattern
- Generate components starting with reusable StatCard
- Compose into main Dashboard component
Scenario 3: Complex Page with Multiple Sections
User: "Implement this landing page [screenshot]"
Approach:
- Read screenshot
- Identify sections: Hero, features grid, testimonials, CTA
- Analyze each section separately using checklist
- Extract shared design tokens
- Generate section components one by one
- Show how sections compose into the full page
- Provide responsive behavior notes
Scenario 4: Component Library Screenshot
User: "Create components from this design system screenshot [screenshot]"
Approach:
- Read screenshot
- Identify: Multiple variations of buttons, inputs, cards shown
- Extract design tokens for the system
- Generate each component variant
- Document the prop variations
- Create a usage guide
- Suggest how to organize in the project
Reference Files Usage
references/ui-analysis-checklist.md
- When to use: During Step 3 (Component Identification) and as a comprehensive analysis guide
- Purpose: Ensures no components or details are missed
- How: Work through checklist sections systematically
references/layout-patterns.md
- When to use: During Step 2 (Layout Analysis) and Step 7 (Code Generation)
- Purpose: Quickly identify common patterns and get implementation code
- How: Match observed layout to pattern, adapt provided code
references/design-tokens.md
- When to use: During Step 4 (Design Token Extraction) and Step 7 (Code Generation)
- Purpose: Map visual elements to Tailwind classes accurately
- How: Use color tables, spacing scale, and component size guides
Tips for Accurate Analysis
- Be systematic - Follow the workflow steps in order, don't skip ahead
- Take measurements - Estimate sizes and spacing carefully
- Look for patterns - Repeated elements indicate design system consistency
- Note uncertainties - Clearly mark assumptions vs confirmed details
- Think responsive - Always consider mobile behavior
- Prioritize accessibility - Include ARIA labels and semantic HTML from the start
- Stay DRY - Extract reusable components when patterns repeat
- Consult references - Use the reference files liberally for accuracy
- Verify with user - Confirm understanding before extensive code generation
- Iterate - Expect refinement based on user feedback
Integration with Other Skills
With react-component-generator skill
When both skills are available:
- Use ui-analyzer to understand the design and extract requirements
- Reference react-component-generator templates for similar components
- Apply ui-analyzer's extracted design tokens to the templates
- Follow react-component-generator's naming and structure conventions
This creates a powerful workflow: analyze → identify template → customize → implement.
Example Full Workflow
User provides login page screenshot
- ✅ Read screenshot and describe the UI
- ✅ Identify: Centered card layout, split-screen with image
- ✅ Extract design tokens:
- Primary blue: #3B82F6 →
bg-blue-500
- Text: #1F2937 →
text-gray-800
- Background: #F9FAFB →
bg-gray-50
- Card padding: ~32px →
p-8
- Input height: ~40px →
h-10
- Button: blue background, white text, rounded-md
- ✅ Identify components:
- Logo/brand element
- Heading and subheading
- Email input (with label)
- Password input (with label, show/hide icon)
- "Remember me" checkbox
- "Forgot password?" link
- Submit button
- Sign up link at bottom
- ✅ Reference layout-patterns.md → Split Screen + Centered Card patterns
- ✅ Generate LoginForm.tsx:
- TypeScript interfaces for props
- Form validation structure
- Tailwind classes matching design
- Accessibility attributes
- Responsive behavior (stacked on mobile)
- ✅ Provide usage example and notes
- ✅ Offer to generate the accompanying image section or adjust styling
Notes
- Always read the screenshot first before any analysis
- Prioritize user confirmation of understanding before extensive code generation
- When in doubt about colors or spacing, choose the closest Tailwind default
- Document all assumptions clearly
- Provide complete, runnable code, not pseudocode
- Consider suggesting improvements while matching the design
- Be prepared to iterate based on user feedback
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: ui-analyzer3description: Analyze UI design screenshots and generate React components with TypeScript and Tailwind CSS. Use this skill when the user provides UI mockups, design screenshots, or Figma exports and requests implementation. Provides detailed layout analysis, component breakdown, design token extraction, and production-ready code generation following best practices. Use when this capability is needed.4---56# UI Analyzer78This skill provides a systematic approach to analyzing UI design screenshots and translating them into production-ready React components using TypeScript and Tailwind CSS.910## Purpose1112Transform UI design screenshots into well-structured, accessible, and maintainable React components. The skill guides through analyzing layouts, extracting design tokens, identifying components, and generating clean code that matches the design while following best practices.1314## When to Use This Skill1516Use this skill when:17- The user provides a UI design screenshot, mockup, or Figma export18- The user requests "implement this design" or "build this UI"19- The user asks to "analyze this screenshot"20- The user wants to convert a design to code21- The user needs help understanding a UI's structure22- The user requests matching an existing design2324## Analysis Workflow2526Follow these steps systematically when analyzing a UI screenshot:2728### Step 1: Initial Observation and Screenshot Reading2930**Read the provided screenshot first** using the Read tool if a file path is provided, or if the user has shared an image in the conversation.3132After viewing the screenshot:331. Describe what you see in the UI342. Identify the screen/page type (login, dashboard, form, etc.)353. Determine the target device (desktop, mobile, responsive)364. Note the overall aesthetic (modern, minimal, colorful, etc.)375. Confirm understanding with the user before proceeding3839### Step 2: Layout Analysis4041Identify the high-level layout structure:42431. **Main layout type** - Consult `references/layout-patterns.md` to identify:44 - Single column45 - Sidebar layout46 - Header + content47 - Grid layout48 - Split screen49 - Dashboard50 - Master-detail51 - Other patterns52532. **Layout hierarchy** - Break down into sections:54 - Header/navigation55 - Main content area56 - Sidebar (if present)57 - Footer (if present)58 - Nested structures59603. **Responsive considerations**:61 - How should layout adapt to mobile?62 - Which elements stack or hide?63 - Breakpoint strategy6465Reference `references/layout-patterns.md` for Tailwind implementation patterns.6667### Step 3: Component Identification6869Systematically identify all UI components using `references/ui-analysis-checklist.md`:7071**Navigation Components**:72- Top nav, sidebar nav, breadcrumbs, tabs, etc.7374**Data Display Components**:75- Cards, tables, lists, stats, badges, avatars, icons, etc.7677**Input Components**:78- Text inputs, selects, checkboxes, radios, switches, date pickers, etc.7980**Action Components**:81- Buttons (primary, secondary, etc.), icon buttons, links, etc.8283**Feedback Components**:84- Alerts, toasts, progress bars, loading states, etc.8586**Overlay Components**:87- Modals, drawers, tooltips, popovers, dropdowns, etc.8889List all identified components with:90- Component type and purpose91- Location in the layout92- Approximate size and styling93- Interactive states (if visible)9495### Step 4: Design Token Extraction9697Extract design system values using `references/design-tokens.md`:9899**Color Palette**:1001. Identify all unique colors in the design1012. Categorize by usage:102 - Primary brand color103 - Secondary/accent colors104 - Background colors (main, secondary)105 - Text colors (primary, secondary, muted)106 - Border colors107 - State colors (success, warning, error, info)1083. Map each color to nearest Tailwind color or note custom color needed1094. Create a color reference table110111**Typography**:1121. Identify font family (serif, sans-serif, monospace)1132. List all text sizes observed1143. Map to Tailwind typography scale (`text-xs` to `text-6xl`)1154. Note font weights used (normal, medium, semibold, bold)1165. Identify heading hierarchy (H1-H6)117118**Spacing**:1191. Observe padding patterns (card padding, button padding, etc.)1202. Observe margin/gap patterns (between sections, between items)1213. Map to Tailwind spacing scale (p-4, m-6, gap-8, etc.)1224. Note the spacing unit (usually 4px or 8px base)123124**Other Tokens**:125- Border radius (rounded-none to rounded-full)126- Shadows (shadow-sm to shadow-2xl)127- Border widths128- Icon sizes129130Reference `references/design-tokens.md` for complete mapping tables.131132### Step 5: Detailed Component Analysis133134For each major component identified:1351361. **Component boundaries** - Where does it start/end?1372. **Props/data** - What data does it receive?1383. **Internal structure** - Sub-components and elements1394. **Styling details**:140 - Background color141 - Text color and size142 - Padding and margins143 - Border and radius144 - Shadow1455. **Interactive states** (if visible or inferable):146 - Hover147 - Active/pressed148 - Focused149 - Disabled150 - Loading151 - Error1526. **Accessibility needs**:153 - ARIA labels154 - Semantic HTML155 - Keyboard navigation156157### Step 6: Implementation Strategy158159Plan the implementation approach:1601611. **Component hierarchy** - Which components to build first?1622. **Reusability** - Which patterns repeat? Extract to reusable components1633. **State management** - Does any component need Zustand or just local state?1644. **Integration with react-component-generator** - Can existing templates be used?1655. **File structure** - Where should components live?166167**If the react-component-generator skill is available**:168- Reference its templates for common components (forms, cards, buttons, modals, etc.)169- Use its best practices for component structure170- Follow its naming conventions171172### Step 7: Code Generation173174Generate React components following these principles:175176**Structure**:1771. Start with TypeScript interfaces for props1782. Use functional components with React.FC1793. Include JSDoc comments1804. Export both named and default exports181182**Styling**:1831. Use Tailwind CSS exclusively for styling1842. Apply extracted design tokens1853. Organize classes logically (layout → spacing → colors → effects → states)1864. Use responsive classes where needed (sm:, md:, lg:, xl:)187188**Best Practices**:1891. Use semantic HTML elements1902. Include ARIA attributes for accessibility1913. Handle loading and error states1924. Support keyboard navigation1935. Use proper TypeScript types (no `any`)1946. Keep components focused and composable195196**Example Component Template**:197```tsx198import React from 'react';199200interface ComponentNameProps {201 // Props based on analysis202 title: string;203 description?: string;204 onClick?: () => void;205 className?: string;206}207208/**209 * ComponentName - Brief description based on UI purpose210 *211 * @param props - Component props212 * @returns JSX.Element213 */214export const ComponentName: React.FC<ComponentNameProps> = ({215 title,216 description,217 onClick,218 className = ''219}) => {220 return (221 <div className={`/* Tailwind classes from design */ ${className}`}>222 {/* Implementation based on screenshot */}223 </div>224 );225};226227export default ComponentName;228```229230### Step 8: Verification and Refinement231232After generating code:2332341. **Review against screenshot** - Does it match the design?2352. **Check responsiveness** - Will it work on different screen sizes?2363. **Verify accessibility** - Are ARIA labels and semantic HTML present?2374. **Validate design tokens** - Are colors, spacing, typography correct?2385. **Consider edge cases** - Long text, empty states, loading states2396. **Note assumptions** - Clearly state what was assumed vs confirmed240241### Step 9: Deliverables242243Provide the user with:2442451. **Analysis Summary**:246 - Layout description247 - Component breakdown248 - Design tokens extracted2492502. **Generated Code**:251 - Complete React component(s)252 - TypeScript interfaces253 - Tailwind classes applied2542553. **Implementation Notes**:256 - Installation requirements (if any packages needed)257 - Usage examples258 - Customization suggestions259 - Responsive behavior notes2602614. **Next Steps**:262 - Suggest improvements or variations263 - Note areas that might need refinement264 - Offer to generate additional related components265266## Common Scenarios267268### Scenario 1: Simple Form Screenshot269270**User**: "Implement this login form design [screenshot]"271272**Approach**:2731. Read screenshot2742. Identify: Centered card layout with form inputs and button2753. Extract: Colors, input styling, button styling, spacing2764. Reference `layout-patterns.md` → "Centered Modal/Card" pattern2775. Reference `react-component-generator` → FormComponent template2786. Generate: LoginForm.tsx with proper validation structure2797. Apply Tailwind classes matching the design280281### Scenario 2: Dashboard Screenshot282283**User**: "Build this dashboard UI [screenshot]"284285**Approach**:2861. Read screenshot2872. Identify: Header + sidebar layout with grid of stat cards2883. Break down into components:289 - Header component290 - Sidebar navigation291 - StatCard component (repeated)292 - Main dashboard layout2934. Extract design tokens for consistency2945. Reference `layout-patterns.md` → "Dashboard Layout" pattern2956. Generate components starting with reusable StatCard2967. Compose into main Dashboard component297298### Scenario 3: Complex Page with Multiple Sections299300**User**: "Implement this landing page [screenshot]"301302**Approach**:3031. Read screenshot3042. Identify sections: Hero, features grid, testimonials, CTA3053. Analyze each section separately using checklist3064. Extract shared design tokens3075. Generate section components one by one3086. Show how sections compose into the full page3097. Provide responsive behavior notes310311### Scenario 4: Component Library Screenshot312313**User**: "Create components from this design system screenshot [screenshot]"314315**Approach**:3161. Read screenshot3172. Identify: Multiple variations of buttons, inputs, cards shown3183. Extract design tokens for the system3194. Generate each component variant3205. Document the prop variations3216. Create a usage guide3227. Suggest how to organize in the project323324## Reference Files Usage325326### references/ui-analysis-checklist.md327- **When to use**: During Step 3 (Component Identification) and as a comprehensive analysis guide328- **Purpose**: Ensures no components or details are missed329- **How**: Work through checklist sections systematically330331### references/layout-patterns.md332- **When to use**: During Step 2 (Layout Analysis) and Step 7 (Code Generation)333- **Purpose**: Quickly identify common patterns and get implementation code334- **How**: Match observed layout to pattern, adapt provided code335336### references/design-tokens.md337- **When to use**: During Step 4 (Design Token Extraction) and Step 7 (Code Generation)338- **Purpose**: Map visual elements to Tailwind classes accurately339- **How**: Use color tables, spacing scale, and component size guides340341## Tips for Accurate Analysis3423431. **Be systematic** - Follow the workflow steps in order, don't skip ahead3442. **Take measurements** - Estimate sizes and spacing carefully3453. **Look for patterns** - Repeated elements indicate design system consistency3464. **Note uncertainties** - Clearly mark assumptions vs confirmed details3475. **Think responsive** - Always consider mobile behavior3486. **Prioritize accessibility** - Include ARIA labels and semantic HTML from the start3497. **Stay DRY** - Extract reusable components when patterns repeat3508. **Consult references** - Use the reference files liberally for accuracy3519. **Verify with user** - Confirm understanding before extensive code generation35210. **Iterate** - Expect refinement based on user feedback353354## Integration with Other Skills355356### With react-component-generator skill357When both skills are available:3581. Use ui-analyzer to understand the design and extract requirements3592. Reference react-component-generator templates for similar components3603. Apply ui-analyzer's extracted design tokens to the templates3614. Follow react-component-generator's naming and structure conventions362363This creates a powerful workflow: analyze → identify template → customize → implement.364365## Example Full Workflow366367**User provides login page screenshot**3683691. ✅ Read screenshot and describe the UI3702. ✅ Identify: Centered card layout, split-screen with image3713. ✅ Extract design tokens:372 - Primary blue: #3B82F6 → `bg-blue-500`373 - Text: #1F2937 → `text-gray-800`374 - Background: #F9FAFB → `bg-gray-50`375 - Card padding: ~32px → `p-8`376 - Input height: ~40px → `h-10`377 - Button: blue background, white text, rounded-md3784. ✅ Identify components:379 - Logo/brand element380 - Heading and subheading381 - Email input (with label)382 - Password input (with label, show/hide icon)383 - "Remember me" checkbox384 - "Forgot password?" link385 - Submit button386 - Sign up link at bottom3875. ✅ Reference layout-patterns.md → Split Screen + Centered Card patterns3886. ✅ Generate LoginForm.tsx:389 - TypeScript interfaces for props390 - Form validation structure391 - Tailwind classes matching design392 - Accessibility attributes393 - Responsive behavior (stacked on mobile)3947. ✅ Provide usage example and notes3958. ✅ Offer to generate the accompanying image section or adjust styling396397## Notes398399- Always read the screenshot first before any analysis400- Prioritize user confirmation of understanding before extensive code generation401- When in doubt about colors or spacing, choose the closest Tailwind default402- Document all assumptions clearly403- Provide complete, runnable code, not pseudocode404- Consider suggesting improvements while matching the design405- Be prepared to iterate based on user feedback406407---408> Converted and distributed by [TomeVault](https://tomevault.io/claim/smallnest) — claim your Tome and manage your conversions.409<!-- tomevault:4.0:skill_md:2026-04-11 -->