screenshot-to-code

122
26
Source

Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.

Install

mkdir -p .claude/skills/screenshot-to-code && curl -L -o skill.zip "https://mcp.directory/api/skills/download/109" && unzip -o skill.zip -d .claude/skills/screenshot-to-code && rm skill.zip

Installs to .claude/skills/screenshot-to-code

About this skill

Screenshot to Code

Convert UI screenshots into production-ready code with accurate styling and structure.

How This Works

When a user provides a screenshot of a UI design:

  1. Analyze the visual design thoroughly
  2. Generate clean, modern code that recreates it
  3. Provide complete, runnable implementation

Instructions

1. Analyze the Screenshot

Examine the image carefully and identify:

  • Layout structure: Grid, flexbox, or custom positioning
  • Components: Buttons, inputs, cards, navigation, modals, etc.
  • Visual details: Colors, fonts, spacing, borders, shadows, borders-radius
  • Responsive considerations: Mobile vs. desktop layout cues

2. Determine the Framework

Ask the user which framework they prefer:

  • React (with Tailwind CSS or styled-components)
  • Vue.js
  • Plain HTML/CSS
  • Next.js

Default: If not specified, use React with Tailwind CSS for modern designs, or plain HTML/CSS for simple pages.

3. Generate Complete Code

Create the implementation:

For React/Vue:

  • Build component hierarchy (break into logical components)
  • Use semantic HTML elements
  • Implement modern CSS (flexbox, grid, custom properties)
  • Include prop types and sensible defaults

For HTML/CSS:

  • Use semantic HTML5 structure
  • Write clean, organized CSS (consider using BEM naming)
  • Make it responsive by default

Critical requirements:

  • Match colors EXACTLY (extract hex codes from screenshot)
  • Match spacing and proportions as closely as possible
  • Use appropriate semantic elements (header, nav, main, section, etc.)
  • Include accessibility attributes (alt text, ARIA labels where needed)

4. Make It Responsive

  • Use responsive units (rem, em, %, vw/vh) rather than fixed pixels
  • Add breakpoints for mobile, tablet, desktop if the design suggests it
  • Use min(), max(), clamp() for fluid typography where appropriate

5. Deliver Complete Implementation

Provide:

  1. Complete code (all files needed, fully functional)
  2. File structure (explain what each file does)
  3. Usage instructions (how to run/use the code)
  4. Notes on design decisions (any assumptions or interpretations)

Output Format

// Example structure for React + Tailwind
import React from 'react';

export default function ComponentName() {
  return (
    <div className="...">
      {/* Component structure */}
    </div>
  );
}

Always include:

  • All necessary imports
  • Any required dependencies
  • Clear comments for complex sections
  • Suggestions for improvements or next steps

Best Practices

  • Accuracy: Match the design as closely as possible
  • Modern CSS: Prefer Grid/Flexbox over floats or tables
  • Accessibility: Include ARIA labels, alt text, semantic HTML
  • Performance: Optimize images, use efficient selectors
  • Maintainability: Write clean, well-organized code with comments
  • Responsiveness: Design mobile-first when possible

Common Patterns

Navigation Bars: Flexbox with space-between, sticky positioning Card Grids: CSS Grid with auto-fit/auto-fill for responsiveness Hero Sections: Full-height with centered content, background images Forms: Proper labels, validation states, accessible inputs Modals: Fixed positioning, backdrop, focus management

When You Can't Match Exactly

If the screenshot is unclear or ambiguous:

  • Make reasonable assumptions based on common UI patterns
  • Note your interpretation in comments
  • Suggest alternatives the user might prefer
  • Ask for clarification on critical decisions

Example Workflow

User provides: Screenshot of a landing page with hero section, feature cards, and footer

Your response:

  1. Analyze: Hero with large headline, 3-column feature grid, simple footer
  2. Ask: "Would you like this in React with Tailwind or plain HTML/CSS?"
  3. Generate: Complete implementation with responsive design
  4. Deliver: All code files with clear structure and usage instructions

Remember: The goal is to produce code so clean and accurate that it could be deployed immediately with minimal modifications.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

287790

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

213415

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

212295

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

219234

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

171200

rust-coding-skill

UtakataKyosui

Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.

166173

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.