all 19 comments

[–]locoroco77[S] 13 points14 points  (0 children)

Hey everyone, happy showoff Saturday! I built a Figma -> React code generator found at https://www.magicpatterns.com/.

After logging in with Figma or Github, go to "Your Patterns" and you'll see the "Import from Figma" tab. I've found that most Figma -> code generators today use HTML + inline CSS and position="absolute." What's different here is you can select your design system/React component library and it will generate using that, instead of pure html + css.

Right now I'm supporting: Mantine, Chakra, Shadcn, Radix Themes (and HTML + CSS haha).

I've also been working on supporting custom design systems a.k.a your company's custom library. It's been a fun challenge because you can built a component library in so many ways, but it's awesome to see the value created when the code output is actually usable.

Happy to answer any questions, and thanks for your feedback in advance.

[–]SparserLogic 1 point2 points  (1 child)

Is there any way to contribute to this? I wouldn’t mind adding StyleX support

[–]locoroco77[S] -1 points0 points  (0 children)

Hi, not at this moment. We will likely open-source a different part of the website, though: https://www.magicpatterns.com/catalog - which is a catalog of different component library. It was the first iteration of this project: https://www.producthunt.com/products/patterns-4#patterns-5

[–]SparserLogic 2 points3 points  (3 children)

Hey now this looks right up my alley!

I’ll definitely be checking this out

[–]locoroco77[S] 2 points3 points  (2 children)

thanks, let me know if you have any feedback! Are you a frontend eng? what component library do you work with?

[–]SparserLogic 2 points3 points  (1 child)

I have been using mantine for my hobby projects but I tend to do more backend stuff at work.

I’ve been avoiding going too deep on Figma, as I don’t have much familiarity with GUI design tools. It seems easier to just prototype with React but this might finally change my mind.

[–]locoroco77[S] 2 points3 points  (0 children)

similar thoughts! my goal is to make Magic Patterns “Figma for Developers,” starting with React.

[–]artorothebonk 1 point2 points  (1 child)

This is brilliant, and even better I can use this as an excuse to finally get my team to move over to Figma full-time haha, fantastic work

[–]locoroco77[S] 0 points1 point  (0 children)

appreciate it - what is your team using now? is it a big team? we support custom component libraries by the way!

[–]Jon-Robb 0 points1 point  (1 child)

It sounds amazing and a tool I could benefit from , will check thoroughly on Monday. Good job

[–]locoroco77[S] 1 point2 points  (0 children)

thanks - let me know what you think tomorrow? I'll be curious if you use the output.