Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude hands work to one, or you mention it with @.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
将 Figma 设计文件和 UI 截图转换为生产就绪的代码组件,内置无障碍性支持。
本插件为 CB Teams Marketplace 的一部分,通过团队配置自动安装。
注意:本插件依赖 MCP 服务器,需要配置 .mcp.json 文件。
从 Figma JSON 导出中提取组件信息并生成代码。
支持提取:
生成内容:
分析 UI 截图的布局并生成对应的代码组件。
适用场景:
根据自定义的布局规格生成代码组件。
适用场景:
所有生成的组件默认包含完整的无障碍性特性。
包含特性:
本插件通过 design-converter MCP 服务器提供 3 个工具:
parse_figma功能:解析 Figma JSON 导出
输入参数:
{
"json": "Figma JSON 导出内容",
"framework": "react | svelte | vue"
}
返回内容:
analyze_screenshot功能:分析 UI 截图布局
输入参数:
{
"imagePath": "截图文件路径",
"framework": "react | svelte | vue"
}
返回内容:
generate_component功能:生成代码组件
输入参数:
{
"layout": {
"type": "container",
"children": [...],
"styles": {...}
},
"framework": "react | svelte | vue",
"includeA11y": true
}
返回内容:
| 框架 | 语法 | 特点 |
|---|---|---|
| React | JSX + Hooks | 企业级应用、丰富生态、TypeScript 支持 |
| Svelte | 单文件组件 | 高性能、简洁语法、小体积 |
| Vue | Composition API | 渐进式、模板语法、官方工具链 |
用户操作:
AI 执行:
// 步骤 1: 解析 Figma JSON
const parsed = await parse_figma({
json: "用户粘贴的 JSON 内容",
framework: "react"
});
// 步骤 2: 生成组件
const component = await generate_component({
layout: parsed.components[0],
framework: "react",
includeA11y: true
});
产出:
import React from 'react';
export default function LoginForm() {
return (
<form role="form" aria-label="登录表单">
<div>
<label htmlFor="username">用户名</label>
<input
id="username"
type="text"
aria-required="true"
/>
</div>
<div>
<label htmlFor="password">密码</label>
<input
id="password"
type="password"
aria-required="true"
/>
</div>
<button type="submit" aria-label="提交登录">
登录
</button>
</form>
);
}
用户操作:
AI 执行:
// 步骤 1: 分析截图
const analysis = await analyze_screenshot({
imagePath: "/path/to/navbar.png",
framework: "svelte"
});
// 步骤 2: 生成组件
const component = await generate_component({
layout: analysis.layout,
framework: "svelte",
includeA11y: true
});
产出:
<nav role="navigation" aria-label="主导航">
<ul>
<li><a href="/" aria-current="page">首页</a></li>
<li><a href="/about">关于</a></li>
<li><a href="/contact">联系</a></li>
</ul>
</nav>
<style>
nav {
display: flex;
padding: 1rem;
}
ul {
display: flex;
gap: 2rem;
list-style: none;
}
</style>
用户需求: "我需要一个产品卡片组件,包含图片、标题、价格和购买按钮"
AI 执行:
const layout = {
type: "card",
children: [
{ type: "image", src: "placeholder", alt: "产品图片" },
{ type: "heading", level: 3, content: "产品名称" },
{ type: "text", content: "¥99.00", className: "price" },
{ type: "button", label: "立即购买", action: "purchase" }
],
styles: {
display: "flex",
flexDirection: "column",
gap: "1rem",
padding: "1.5rem",
border: "1px solid #ddd",
borderRadius: "8px"
}
};
const component = await generate_component({
layout,
framework: "vue",
includeA11y: true
});
产出:
<template>
<article class="product-card" role="article">
<img :src="product.image" :alt="product.name" />
<h3>{{ product.name }}</h3>
<p class="price" aria-label="价格">{{ product.price }}</p>
<button
@click="handlePurchase"
aria-label="购买产品"
>
立即购买
</button>
</article>
</template>
<script setup>
import { ref } from 'vue';
const product = ref({
image: '/placeholder.jpg',
name: '产品名称',
price: '¥99.00'
});
const handlePurchase = () => {
// 购买逻辑
};
</script>
<style scoped>
.product-card {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1.5rem;
border: 1px solid #ddd;
border-radius: 8px;
}
</style>
1. 用户在 Figma 中设计
↓
2. 导出为 JSON (Copy as JSON)
↓
3. AI 使用 parse_figma 解析
↓
4. AI 使用 generate_component 生成代码
↓
5. 用户审查和优化代码
↓
6. 添加业务逻辑和样式细节
1. 用户提供 UI 截图
↓
2. AI 使用 analyze_screenshot 分析
↓
3. AI 使用 generate_component 生成代码
↓
4. 用户审查和调整布局
↓
5. 完善交互逻辑和响应式设计
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub tunoc2c/workbuddy-experts --plugin design-to-codePlugins from other owners that cover similar ground