Install
openclaw skills install ai-image-to-code-v2Use when (1) user provides a UI screenshot or image and asks to convert it into HTML, CSS, or component code. (2) user says "turn this into code", "rebuild this UI", "code this design", or "generate HTML from screenshot". (3) user pastes an image and says "write the React component for this".
openclaw skills install ai-image-to-code-v2Use when (1) user provides a UI screenshot or image and asks to convert it into HTML, CSS, or component code. (2) user says "turn this into code", "rebuild this UI", "code this design", or "generate HTML from screenshot". (3) user pastes an image and says "write the React component for this".
This skill solves the specific problem of: a visual UI mockup needs to become actual runnable frontend code — not just a description, but a working implementation.
This skill IS NOT:
This skill IS activated ONLY when: image (screenshot/mockup) + code generation intent are both present.
/ai-image-to-codeDefault mode. Converts a UI image into a complete HTML/CSS implementation.
When to use: User provides a screenshot and wants a working HTML page that resembles it.
/ai-image-to-code/reactOutputs a React functional component using Tailwind CSS.
When to use: User explicitly asks for React or a component, not a plain HTML page.
/ai-image-to-code/describeProvides a detailed text description of the layout without writing code.
When to use: User only wants to understand the layout before committing to code generation.
| Image Content | Recommended Output |
|---|---|
| Landing page | Single HTML with embedded CSS |
| Dashboard | HTML + CSS grid layout |
| Mobile app screen | Mobile-first responsive HTML |
| Form / login page | Semantic HTML form with proper inputs |
| Card / list UI | Component-based HTML with classes |
| Chart / data visualization | SVG or canvas-based rendering |
HTML/CSS output (default):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UI</title>
<style>
/* Extracted colors, typography, spacing from image */
</style>
</head>
<body>
<!-- Structure matching the image layout -->
</body>
</html>
React + Tailwind (react mode):
export function UICard() {
return (
<div className="p-6 bg-white rounded-xl shadow-sm">
{/* Component matching image */}
</div>
);
}
A good output:
A bad output:
| Scenario | Bad Output | Good Output |
|---|---|---|
| E-commerce product card | Generic lorem ipsum text | "Price: $49.99 — Add to Cart" contextually appropriate |
| Dark mode UI | Ignores dark theme | Uses dark background, light text, correct contrast |
| Mobile screenshot | Desktop-only output | max-width: 375px container, mobile-first |
| Complex dashboard | One undifferentiated div | Grid layout with sidebar, header, main panels |
references/ — Color extraction heuristics, layout structure patterns, Tailwind class mapping guide