Figma's Code Connect links a component to React, SwiftUI, Compose, and Vue

- Reading
- 7 min
The same design component can point to implementations in React, SwiftUI, Jetpack Compose, and Vue at the same time, reopening the conversation about who decides variant and state names.
Code Connect's documentation describes a feature that links a design component to multiple code implementations at the same time: the same component can point to React, SwiftUI, Jetpack Compose, and Vue simultaneously, reopening the conversation about who decides variant and state names.
The source-of-truth component inside Figma
By default, Figma's Dev Mode still generates code from the design for components without a connection: generic CSS or snippets, with no direct relationship to what exists in the repository. For those who configure Code Connect, that logic changes. According to the feature's official documentation, it creates an explicit link between the component published in Figma's library and the real component that lives in the code, which, according to the documentation, improves the ability of Figma's MCP server to guide AI agents with more precise implementation details, giving them "direct references to your source-of-truth code".
In practice, this means that for connected components, clicking a button drawn in Figma no longer shows someone in Dev Mode a guess at how that button should look in code. They see the production component's snippet, with the props the engineering team actually uses. Components that aren't connected yet keep showing Dev Mode's standard generic snippet. It's a small change in the interface and a big one in governance: design stops being the sole source of truth for whoever adopts the feature.
Two entry points, one destination
Figma offers two ways to create these connections, and they don't compete with each other. Code Connect UI runs entirely inside Figma: it's possible to authorize access to a GitHub repository and point to components directly through the interface, or manually map the file path and component name, with no GitHub at all. It's the quicker option, and the one best suited for mixed design and engineering teams who want something collaborative without touching a terminal.
Code Connect CLI runs locally, inside the repository itself, and publishes the connections to Figma from there. Instead of just pointing to a path, it uses template files to map Figma properties to the real properties of the production component's API, which generates dynamic, precise code examples. The documentation is direct about the audience for each tool:
Code Connect UI: Best for design and engineering teams who want an accessible, collaborative setup. Code Connect CLI: Best for developers who want precision and flexibility in how design and code are connected.
Figma Developers, Code Connect documentation
Both feed the same structure: connections made via the CLI appear in the UI, but can only be edited back in the CLI.
One component, multiple stacks at once
The point that changes the game for teams with a multiplatform product is support for one-to-many connections. Code Connect UI allows mapping a single design component to multiple code implementations, in different languages or frameworks. The example the documentation itself uses is direct: a Button component can have simultaneous connections to React, SwiftUI, Jetpack Compose, and Vue.
Each connection is independent. This means the file path, the component name, and the custom instructions can differ for each framework, even starting from the same design in Figma. A design system that today serves both web and native mobile no longer needs parallel documentation explaining "this is how it works in React, and like this in SwiftUI": the explanation lives inside the design file itself, per framework.
For those who decide design system architecture, this reduces a real pain point: the silent divergence between the web and native versions of the same component, which only showed up when someone compared the two products side by side.
The bridge to AI agents via MCP
Connections created through either path feed Figma's MCP server, which exposes that context to AI-enabled tools and editors. When an AI agent is tasked with implementing a screen, it now sees not just the design, but the component's path, the name used in production, and custom instructions left by the team.
This has a practical effect: Code Connect UI includes AI-generated code previews based on the connected source files, visible right inside Dev Mode, for anyone who wants to understand the implementation even before the formal handoff. The documentation makes an important caveat: these previews are generated in a different context than the one the AI agent uses in an actual conversation, so the final code may vary somewhat from what appears in the preview.
Code Connect CLI, on the other hand, goes beyond the preview: it replaces Dev Mode's auto-generated snippet with real examples, defined by the design system itself, mapping Figma properties to the production component's API. Only components connected via the CLI show that snippet inside the inspection panel; those connected only through the UI show path and name, with the AI preview kept separate.
Who decides variant names now?
This is where the angle that matters for those working at the border between design and development lives. Before Code Connect, variant, state, and property naming could diverge between Figma and code without anyone noticing until handoff day. With the real component now appearing inside the design file, that divergence becomes visible to anyone who opens Dev Mode, not just whoever reads the pull request.
This shifts a decision that used to be implicitly design's call (how to name "Primary", "Hover", "Disabled") into an explicit negotiation with whoever maintains the component in production. It makes sense: if the real prop in the code is called variant="danger" and Figma calls the same variant "Destructive", Code Connect's mapping has to decide which name prevails in the living documentation that reaches the AI agent and the junior developer.
In practice, teams that adopt Code Connect CLI with template files will need a review ritual that many design systems don't have today: someone from design and someone from engineering reviewing together, periodically, whether the property mapping still reflects the production component. The documentation itself recommends this step:
Review in Dev Mode. Review the Code Connect CLI output with your developers and designers to ensure the component examples are useful and accurately represent your production components.
Figma Developers, Code Connect documentation
Without that ritual, Code Connect turns into an outdated source of truth faster than the wiki documentation it's supposed to replace.
The point the documentation doesn't cover: accessibility
A gap that stands out for anyone who thinks of accessibility as part of the definition of done: Code Connect's documentation talks about file path, component name, custom instructions, and visual property mapping, but doesn't mention anything about accessibility attributes, like aria-label, role, or focus states mapped between design and code.
That's not a flaw in the feature, it's a clear limit of its current scope. If an AI agent is going to generate code from these connections, it's up to the team writing the template files to make sure the referenced production implementation already has the correct accessibility layer, because Code Connect will faithfully reproduce whatever is there, good or bad. The feature mirrors the quality of the source component, it doesn't fix it.
When it's not worth the effort
Code Connect UI and CLI assume a design system already published as a library, with production components stable enough to map. For small teams, without a formalized design system, or still at the prototype stage not yet coded, setting up these connections is upfront work with no payoff: there's no production component to point to, and Dev Mode will keep generating generic snippets anyway.
It's also worth noting the plan limitation: Professional accounts only support one active library and one active framework at a time, and switching the active framework deactivates previous connections without deleting them. The documentation doesn't detail the behavior of multiple simultaneously active libraries and frameworks for the other plans (Education, Organization, Government, and Enterprise), and it also notes that Figma for Government only supports Code Connect CLI, without the UI option.
Translated from the Brazilian Portuguese original · Read the original
Figma's Dev Mode MCP Server: what changes in handoff when AI reads the file's variables and components directly
Figma's official guide details what the Dev Mode MCP Server exposes to agents like Cursor and Claude Code: variables, components, layout and, now, the ability to write back to the canvas. Traditional handoff doesn't survive as is.





