Learn how to use Figma Code Connect with the shadcn/ui Figma kit. Connect your 2000+ components to your codebase for seamless AI-assisted code generation with a step-by-step Code Connect UI setup.

If you've ever watched a developer squint at a Figma design, trying to translate your carefully crafted components into code, you know the handoff gap is real. Even with the best design systems, something always gets lost in translation. Spacing feels off. Variants don't match. The code doesn't reflect the design's structure.
Figma Code Connect changes that. It's a bridge between your Figma design files and your actual codebase, connecting design components directly to their code implementations. When AI tools like Cursor or Claude read your Figma designs, they get precise references to your real code—not generic examples, but your actual components, props, and patterns.
The shadcn/ui kit for Figma is built for this. With 2000+ components that mirror the shadcn/ui codebase, proper variants, Figma Variables, and a structure that matches production code, it's the ideal foundation for Code Connect. In this guide, you'll learn how to set up Figma Code Connect with our Figma kit using the visual Code Connect UI approach. If your team needs the CLI workflow, check the official Code Connect docs.
Yes, absolutely! The shadcn/ui kit for Figma is specifically designed to work with Figma Code Connect. In fact, it's one of the best Figma kits for Code Connect because:
Whether you're using Code Connect UI (the visual approach in Figma) or Code Connect CLI (for developers), the shadcn/ui kit provides the foundation you need. The rest of this guide walks you through setting it up step by step.
Code Connect is Figma's solution for linking design components to their code implementations. It creates a two-way connection: your Figma components know where they live in your codebase, and AI tools can reference that code when generating implementations.
The Figma MCP (Model Context Protocol) server is what allows AI tools to read and understand your Figma designs. Code Connect supercharges this by adding direct code references. Instead of AI generating generic code examples, it can:
This means when a developer opens Dev Mode in Figma, they see code snippets from your actual repository, not placeholder examples. When AI tools analyze your designs, they understand the component architecture because they can see the real code.
shadcn/ui follows an ownership model—you copy components into your repo and maintain them yourself. This gives you control, but it also means your Figma designs need to map accurately to your codebase. Code Connect ensures that mapping is explicit and accurate.
With Code Connect, your design system becomes a single source of truth that both designers and developers can trust. Designers work in Figma with components that match the code. Developers get precise references when implementing. AI tools understand the full context.
The shadcn/ui kit for Figma isn't just a collection of components—it's built to mirror the actual shadcn/ui codebase structure. This makes it ideal for Code Connect in several ways:
Every component in the kit uses Figma's Variants and Component Properties correctly. A Button component has variants for size, variant style, and state. An Input has variants for error states, disabled states, and sizes. This structure maps directly to how shadcn/ui components work in code, making the connection straightforward.
The kit uses Figma Variables for colors, spacing, typography, and radii. These variables correspond to Tailwind CSS tokens and CSS custom properties in your codebase. When Code Connect references a component, it can see which variables are used and map them to your actual design tokens.
Components are organized the same way as in the shadcn/ui registry. A Button component in Figma corresponds to components/ui/button.tsx in code. This predictable structure makes automatic mapping reliable and maintainable.
Components use Auto Layout for responsive behavior and Component Properties for interactive states. This means Code Connect can understand not just what a component looks like, but how it behaves and adapts—information that's crucial for accurate code generation.
The kit supports multiple brands through Figma Variables, allowing you to switch entire color palettes, typography scales, and spacing systems. Code Connect can reference the active variable set, ensuring generated code uses the correct tokens for your brand.
Code Connect UI runs entirely inside Figma. It's visual, language-agnostic, and perfect for teams who want a simple way to link design components to code without touching the command line.
Code Connect UI lets you map components directly in Figma's interface. You can connect to a GitHub repository for automatic component discovery, or manually link components by providing file paths and component names. Once mapped, this information feeds into the Figma MCP server, making it available to AI tools.
Before you start make sure you have a proper Figma workspace plan. Code Connect requires an Organization or Enterprise Figma plan.
First, ensure you have the shadcn/ui kit for Figma open. If you're using it as a library, make sure it's published and available in your workspace. You'll be mapping components from this library to your codebase.
Code Connect UI is available in Dev Mode. To access it:
Shift + D)If you don't see Code Connect options, you may need to enable it in your Figma organization settings (Code Connect requires an Organization or Enterprise Figma plan).
For automatic component discovery, you can connect Figma to your GitHub repository:
This is optional—you can map components manually without a GitHub connection.
If you're not using GitHub or prefer manual control, you can map components directly:
components/ui/button.tsxcomponents/custom/my-component.tsxButton)For shadcn/ui components, the mapping is straightforward:
components/ui/button.tsx → Buttoncomponents/ui/input.tsx → Inputcomponents/ui/card.tsx → Cardcomponents/ui/dialog.tsx → DialogThe shadcn/ui kit components map directly to the shadcn/ui codebase structure. Here's a quick reference for common components:
| Figma Component | Code Path | Component Name |
|---|---|---|
| Button | components/ui/button.tsx | Button |
| Input | components/ui/input.tsx | Input |
| Card | components/ui/card.tsx | Card |
| Dialog | components/ui/dialog.tsx | Dialog |
| Select | components/ui/select.tsx | Select |
| Tabs | components/ui/tabs.tsx | Tabs |
| Accordion | components/ui/accordion.tsx | Accordion |
| Alert | components/ui/alert.tsx | Alert |
If you've customized components or added new ones, map them to their actual file paths in your repository.
You can enhance Code Connect mappings with custom notes and usage instructions:
For example, for a Button component, you might add:
Use the variant prop to control style: "default", "destructive", "outline", "secondary", "ghost", or "link".
Use the size prop for sizing: "default", "sm", "lg", "icon", "icon-lg", and "icon-sm".
Once components are mapped, you can preview how they'll appear in AI-generated code:
This helps you verify that mappings are correct before developers start using them.
Consistent naming makes Code Connect more reliable:
size="sm")Let's walk through connecting a Button component from the shadcn/ui Figma kit to your codebase using Code Connect UI.
In your Figma file, locate the Button component from the shadcn/ui kit. Note its properties:
Shift + D)components/ui/button.tsxButtonInclude a note that maps Figma variants to React props. Example note:
Variants map to props:
- Variant → variant prop (default, destructive, outline, secondary, ghost, link)
- Size → size prop (default, sm, lg, icon, icon-sm, icon-lg)
When using AI tools like Cursor with Figma MCP:
Issue: Figma can't connect to your GitHub repository.
Solutions:
Issue: Code Connect can't find a component in your codebase.
Solutions:
Issue: Figma variants don't map correctly to React props.
Solutions:
figma.enum() for variant mappingsIssue: Connections don't appear in Dev Mode or MCP responses.
Solutions:
figma connect publish)Issue: Generated code examples don't match your component structure.
Solutions:
example function in the connection fileFigma Code Connect transforms how design and development teams collaborate. By connecting your shadcn/ui Figma kit directly to your codebase, you create a seamless bridge that AI tools can use to generate accurate, production-ready code.
The shadcn/ui kit for Figma is built for this workflow. With 2000+ components that mirror the codebase structure, proper variants, and Figma Variables, it provides the foundation Code Connect needs to work effectively.
When you lean on the Code Connect UI workflow, designers and developers stay aligned. Developers get accurate code references. AI tools understand your component architecture. Your design system becomes a true single source of truth. Need the CLI instead? Follow the official Code Connect documentation.
Ready to get started? Get the shadcn/ui kit for Figma and begin connecting your components today. For more advanced workflows, check out our Figma to shadcn/ui plugin and explore Pro Blocks for production-ready patterns. Learn more about shadcn/ui components and how they work with Code Connect.
Want to learn more about using Figma with shadcn/ui? Visit our Academy for comprehensive courses on design systems, component architecture, and design-to-code workflows.
Founder @ shadcndesign.com

A practical guide to theming shadcn/ui with CSS variables: OKLCH tokens, dark mode, custom brand palettes, and applying a full theme in minutes.

How shadcn/ui charts actually work: what ChartContainer does, how ChartConfig drives colors, and what breaks when you move from Recharts 2 to Recharts 3.

How shadcn/ui registries actually work: registry.json, URL resolution, styles, and namespaces — explained by a team that runs a production registry.