Code Connect enters beta

Figma has announced the beta of Code Connect, a tool aimed at improving design system adoption by making code more accessible and useful for developers. The feature lets teams customize the snippets shown in Dev Mode so that developers see their actual design system code in place of auto-generated CSS.

Prior Figma work in this area includes auto layout, variables, component props and last year's Dev Mode launch. Adoption, however, remains the persistent problem: customers repeatedly report that a design system exists but isn't used to its full potential, with developers either unaware of its contents or misusing components and patterns against the system's guidelines.

Bridging design and code

Figma frames the adoption gap as part of a wider disconnect between the two disciplines. Designers optimize for creativity and exploration, developers for structure and maintainability, and the two groups work in different tools under different constraints. According to CEO Dylan Field:

"There's a natural tension between design and code. In the world of design, the focus is deciding what to build—in the world of code, the focus is building it…In practice, they're partners working to bring a product to life."

Code Connect is presented as a step toward moving seamlessly between freeform exploration and structured, systematic implementation.

Figma Designer Advocate Ana Boyer hosted a Design to Code: Roundtable discussion with Bumble, GitHub, and HP, where the participants covered common design-system-to-code challenges and gave first impressions of Code Connect. Jake Albaugh, Figma developer advocate, also shared an overview of connecting a design system with Code Connect along with getting-started tips.

Packaging and platform support

The tool is distributed as an npm utility for JavaScript and TypeScript projects and through Swift Package Manager for SwiftUI projects. The package and setup instructions live in the figma/code-connect GitHub repository, and installation runs through a command line interface. Additional platform support is planned.

After installation, design system teams publish best practices and documentation tied contextually to mockups. A developer clicking a mockup receives approved, maintained code samples published by the design systems team rather than having to search through code and docs.

1import * as figma from '@figma/code-connect'
2
3figma.connect(Button, 'https://...', {
4  props: {
5    label: figma.string('Text Content'),
6    disabled: figma.boolean('Disabled'),
7    type: figma.enum('Type', {
8      Primary: 'primary',
9      Secondary: 'secondary',
10    }),
11  },
12  example: ({ disabled, text, type }) => {
13    return (
14      <Button disabled={disabled} type={type}>
15        {text}
16      </Button>
17    )
18  },
19})
20
1import Figma
2
3struct Button_connection : FigmaConnect {
4  let component = Button.self
5  let figmaNodeUrl: String = "https://..."
6
7  @FigmaProp("Text Content")
8  var label: String = "Submit"
9
10  @FigmaProp("disabled")
11  var disabled: Bool = false
12
13   @FigmaProp(
14      "Variant",
15      mapping: [
16          "Primary": ButtonVariant.primary,
17          "Secondary": ButtonVariant.secondary,
18          "Destructive": ButtonVariant.danger
19      ]
20  )
21  var type: ButtonType = .primary
22
23   var body: some View {
24      Button(type: self.type, disabled: self.disabled, label: {
25          Text(self.label)
26      })
27   }
28}

What the tool does—and doesn't do

Code Connect does not generate new code. It surfaces and distributes the approved, maintained samples and documentation already published by the design systems team, avoiding automated code generation that could introduce errors or inconsistencies. Teams get less code to maintain because developers reuse existing components instead of rewriting them, and stronger adherence to the system makes accessibility and consistency improvements easier across applications.

Figma positions this as a way to make the design system the path of least resistance. The need grows with team size, since silos form as organizations scale and the design system risks becoming a loose assemblage of guidelines rather than a shared standard.

Roadmap and availability

Code Connect is in beta for Figma Organization and Enterprise plans, with general availability planned for later this year. Figma intends to integrate it fully into its workflow, including the component playground, with support for additional platforms such as Android and web frameworks.

Looking further ahead, the design-to-code connection opens possibilities Figma says are not currently on its roadmap: automatic audits of design system usage in both code and design to spot drift, analytics and insights into how a system is used in practice, and approval flows between design and engineering for component updates. Longer term, Figma describes extending the connection beyond design systems and components to variables, iconography and typography.