category: Getting Started title: Design to Code subTitle: Dark Mode icon: doc-code localeCode: en-US
D2C is the abbreviation of Design to Code, which means converting design drafts into code. As an auxiliary tool for frontend engineers, it can effectively improve the efficiency of design draft restoration and reduce the cost of manual Html/CSS coding.
Thanks to the continuous enhancement of the native capabilities of the Figma platform ecosystem (such as Variant, DevMode, CodeConnect, etc.), the usability of D2C tools in the production environment has been greatly improved in recent years. They can support the access of complete design systems and achieve component - level identification and code output.
At the same time, with the help of AI models, it is possible to effectively rewrite the template style code translated from Figma to supplement business logic.
Semi D2C provides out-of-the-box design to code abilities: it supports one-click identification of layer layouts and design system components on Figma pages, achieves pixel perfect reproduction of design drafts, and translation into React JSX and CSS code. In addition, it also provides rich expansion capabilities. Based on a flexible plugin system, it can quickly create team specific design and R&D collaboration tools without starting from scratch.
With the help of D2C, you can delegate the UI restoration work to the tool and focus more on implementing business logic.
We provide multiple forms of invocation methods:
Figma Plugin: Quickly launched through Figma DevMode. You can directly obtain the corresponding code by clicking on the layer, and it supports the output of different code formats. It also supports freely consuming the Abstract Syntax Tree (AST) through a custom plugin and customizing the code generation results.
OpenApi: An open Http service that provides the ability to parse the corresponding code based on the Figma URL. It can be used to integrate D2C into business processes, such as LowCode building platforms and the construction of MCP services, etc. (Available internally in ByteDance. This capability is not yet provided in the community version.)
NodeSdk: It has strong customization and can be used to encapsulate the team's private D2C capabilities, such as CLI/HTTP services/VS Code plugins (Available internally in ByteDance. This capability is not yet provided in the community version.)
For more detailed usage instructions, you can visit the D2C Official Website for reference.
Here is a link to the Figma example mockup and its corresponding Codesandbox transpiled using the Semi Figma plugin.
Screenshot & Figma URL | Draft Type | Desciption | Codesandbox |
---|---|---|---|
![]() |
A module with simple content without components | Can be used to quickly restore layout and content | Link |
![]() |
Modules that do not contain components, have more content, or have a slightly more complex layout | Can be used to quickly restore layout and content | Link |
Module with Semi Form Components | Can be used to quickly restore the layout and content, and identify the Props of the Semi component | Link | |
Module with Semi Table Components | Can be used to quickly identify table columns, create Table | Link | |
![]() |
Full landing page | Can be used to quickly restore layout and content | Link |
Generally speaking, in addition to relying on Figma To Code/Sketch To Code on specific design platforms for design to code conversion, there is also Image to Code. Code generation based on AI models can also be considered a variant of Image to Code.
Image To Code:
Figma To Code:
D2C + AI is the technical approach that can best balance the design restoration degree and the high availability of generated code at the current stage (D2C + AI = 🚀 Pixel Perfect + 🔩 highly maintainable code)