Creating a Figma plugin to convert designs into React components

I’m working on a project where I need to build a Figma plugin that can automatically generate React functional components from my Figma designs. I already have a collection of custom React components ready to use - things like DataGrid, ActionButton, PageNavigator, and other UI elements. My goal is to create a plugin that can analyze a Figma design and output a complete React page using these existing components I’ve built. Has anyone done something similar before? I’m wondering if this kind of automatic conversion from design to code is technically feasible with Figma’s plugin API. Any guidance on the best approach would be really helpful.

Built something like this 8 months ago for our design system. Figma’s plugin API can handle it, but you’ll need solid mapping logic. The tricky part is getting your plugin to recognize which Figma elements match your custom components - I used layer names, component instances, and auto-layout properties as identifiers. Plugin reads the design through Figma’s API and spits out JSX using predefined templates for each component. Performance gets rough with complex designs since you’re walking the entire node tree. Start simple - pick one or two component types for a proof of concept first. Your generated code quality depends on how consistent your Figma naming is.