A Figma plugin that scans your icon library and publishes React components to GitHub with one click. Designed to streamline the workflow between designers and frontend teams for maintaining a custom icon system.
- Three categories:
Outlined/Filled/Colored— handled with different color strategies - Naming validation: PascalCase enforcement, duplicate detection, with Chinese error messages
- Smart color handling: Automatically strips hardcoded colors from SVG so
currentColor/colorprop works correctly - One-click publish: Pushes all generated components as a single GitHub commit via Git Data API
- Persistent config: GitHub credentials saved locally via
figma.clientStorage
Your Figma file must follow these rules (validated by the plugin):
- At least one Page whose name contains
icon(case-insensitive) - Under that page, top-level Frames must end with
Outlined,Filled, orColored - All icon Components must use PascalCase naming (e.g.
ArrowUp,ChevronDown) - No duplicate names within the same category
- No
<mask>in the exported SVG. Almost always caused by an Inside-aligned stroke — check your Union / Subtract boolean shapes first, since the stroke left on a merged shape is the usual culprit. Fix it with Outline Stroke (keeps the look identical); switching alignment to Center also works but expands the stroke by half its width. The other cause is Clip content on a layer or frame — uncheck it.clipPathand gradients are fine.
For end users — no build needed:
- Download the latest
figma-icon-manager-vX.Y.Z.zipfrom the Releases page - Unzip it anywhere on your machine
- In Figma:
Plugins → Development → Import plugin from manifest...→ select themanifest.jsoninside the unzipped folder
For developers — build from source: see the Development section below.
- Configure GitHub — Click Settings, fill in:
- Personal Access Token (needs
reposcope) - Repository owner / name
- Target branch (e.g.
main) - Base path in repo (e.g.
src/icons)
- Personal Access Token (needs
- Scan icons — Validates the file structure and naming
- Publish — Pushes generated components to GitHub
<basePath>/
├── types.ts # Shared IconProps type
├── index.ts # Re-exports Outlined / Filled / Colored namespaces
├── outlined/
│ ├── ArrowUp.tsx # forwardRef, supports size / color / strokeWidth
│ └── index.ts
├── filled/
│ ├── Heart.tsx # forwardRef, supports size / color
│ └── index.ts
└── colored/
├── Flag.tsx # forwardRef, preserves original colors
└── index.ts
Usage in your React app:
import { Outlined, Filled, Colored } from '@/icons';
<Outlined.ArrowUp size={20} color="#FF0000" />
<Filled.Heart className="text-red-500" />
<Colored.Flag size={32} />npm install
npm run build # Build for production
npm run dev # Watch mode for developmentThen in Figma, import manifest.json via Plugins → Development → Import plugin from manifest...
- TypeScript + React 18
- Webpack 5 (with inline script bundling for Figma UI)
- GitHub REST API (Git Data API for atomic multi-file commits)
MIT © KinyooZ
一个 Figma 图标管理插件:扫描 Figma 文件中的图标,一键发布 React 组件到 GitHub 仓库。用于打通设计师和前端之间的协作流程,统一维护自定义图标系统。
- 三大分类:
Outlined/Filled/Colored,按类型分别处理颜色 - 命名校验:强制大驼峰命名、检测重名,所有报错中文提示
- 智能颜色处理:自动剥离 SVG 中的硬编码颜色,使
currentColor/color属性正确生效 - 一键发布:通过 GitHub Git Data API 以单次 commit 批量推送所有组件
- 配置持久化:GitHub 凭据通过
figma.clientStorage本地保存
Figma 文件必须遵循以下结构(插件会校验):
- 至少有一个名称包含
icon的 Page(不区分大小写) - Page 下的顶层 Frame 必须以
Outlined/Filled/Colored结尾 - 所有 icon Component 必须使用大驼峰命名(如
ArrowUp、ChevronDown) - 同一分类内组件名不可重复
- 导出的 SVG 中不能含
<mask>蒙版。绝大多数是内部 Inside 描边导致的 —— 优先检查 Union / Subtract 等布尔拼合形状,拼合后残留的那圈描边是最常见的成因。 用轮廓化描边 Outline Stroke 修复(外观完全不变);改成居中 Center 也可以, 但描边会外扩半个线宽。另一种成因是图层/画板勾选了裁剪内容 Clip content,取消勾选即可。clipPath和渐变不受限制。
普通用户 — 无需构建:
- 从 Releases 页面 下载最新的
figma-icon-manager-vX.Y.Z.zip - 解压到任意位置
- 在 Figma 中:
Plugins → Development → Import plugin from manifest...→ 选择解压后文件夹里的manifest.json
开发者 — 从源码构建: 请参考下方 本地开发 章节。
- 配置 GitHub — 点击设置,填入:
- Personal Access Token(需要
repo权限) - 仓库拥有者 / 名称
- 目标分支(如
main) - 图标文件在仓库中的基础路径(如
src/icons)
- Personal Access Token(需要
- 扫描图标 — 校验 Figma 文件结构和命名
- 发布 — 推送生成的组件到 GitHub
<basePath>/
├── types.ts # 共享的 IconProps 类型
├── index.ts # 入口文件,re-export Outlined / Filled / Colored 命名空间
├── outlined/
│ ├── ArrowUp.tsx # forwardRef 组件,支持 size / color / strokeWidth
│ └── index.ts
├── filled/
│ ├── Heart.tsx # forwardRef 组件,支持 size / color
│ └── index.ts
└── colored/
├── Flag.tsx # forwardRef 组件,保留原始颜色
└── index.ts
在 React 项目中使用:
import { Outlined, Filled, Colored } from '@/icons';
<Outlined.ArrowUp size={20} color="#FF0000" />
<Filled.Heart className="text-red-500" />
<Colored.Flag size={32} />npm install
npm run build # 生产构建
npm run dev # 开发模式(watch)构建完成后,在 Figma 中通过 Plugins → Development → Import plugin from manifest... 导入 manifest.json。
- TypeScript + React 18
- Webpack 5(Figma UI 使用 inline script 打包)
- GitHub REST API(通过 Git Data API 实现原子性多文件 commit)
MIT © KinyooZ