Loading...
Loading...
Sync design system components between Figma and code using Code Connect mappings
npx skill4agent add thebushidocollective/han figma-sync-design-system// Button.figma.tsx
import figma from '@figma/code-connect';
import { Button } from './Button';
figma.connect(
Button,
'https://www.figma.com/file/abc123?node-id=1:234',
{
props: {
variant: figma.enum('Variant', {
Primary: 'primary',
Secondary: 'secondary',
}),
size: figma.enum('Size', {
Small: 'sm',
Medium: 'md',
Large: 'lg',
}),
disabled: figma.boolean('Disabled'),
children: figma.string('Label'),
},
example: ({ variant, size, disabled, children }) => (
<Button variant={variant} size={size} disabled={disabled}>
{children}
</Button>
),
}
);# Design System Sync Report
Generated: [date]
Figma File: [file name and URL]
Code Location: [path to component library]
## Summary
- Total Figma Components: 45
- Total Code Components: 38
- Synced Components: 35
- Needs Generation: 10
- Needs Update: 3
- Needs Code Connect: 7
## Components Needing Action
### Generate (Figma → Code)
1. **AlertDialog**
- Variants: Info, Warning, Error, Success
- Props: title, message, onClose, onConfirm
- Figma: [URL]
2. **Tooltip**
- Variants: Top, Right, Bottom, Left
- Props: content, trigger, delay
- Figma: [URL]
### Update (Align Code with Figma)
1. **Button**
- Missing variant: Ghost
- New prop: iconPosition (left/right)
- Action: Add variant and prop to code
### Create Code Connect
1. **Card**
- Code exists at: src/components/Card/Card.tsx
- Figma: [URL]
- Action: Create Card.figma.tsx mapping
## Recommendations
1. Consolidate Button and IconButton components
2. Standardize size prop values across all components
3. Add missing documentation to Input component
4. Consider deprecating old Badge variants