Convert Figma Designs to .NET MAUI Graphics Code

Convert Figma Designs to .NET MAUI Graphics Code

Use FigmaSharp.Maui.Graphics to convert Figma designs to .NET MAUI Graphics code.

Last updated 9/23/2022 11:42 AM
jsuarezruiz
2 min read
Category
.NET
Tags
.NET C# MAUI Figma

Link to original: https://github.com/jsuarezruiz/figma-to-maui-graphics

Author: jsuarezruiz

Translation: DesertEndWolf (with Google Translate assistance). If the translation feels off, it's recommended to read the original text directly.

Convert Figma designs to .NET MAUI Graphics code using FigmaSharp.Maui.Graphics. Free and open source under the MIT license. Here's an image to help you understand the MIT license.

Further introduction:

See the results in two thumbnails:

The tool, available on Windows and macOS, performs the following steps:

  1. Access a Figma document using a Personal Access Token.
  2. Fetch all information and create a node hierarchy that we can iterate or manipulate.
  3. Once nodes are obtained, it generates C# code for .NET MAUI Graphics.
  4. After code generation, it compiles the code to ensure no errors were produced.

You can copy and paste the code or export it directly to a file.

Note: This project uses and extends FigmaSharp.

Keep in mind that this tool generates C# code for .NET MAUI Graphics, not XAML or C# code using .NET MAUI views.

Getting Started

To access documents on figma.com, you need to generate a Personal Access Token. Log in to Figma, and from the main menu, go to Help and AccountAccount Settings and select Create new token. This will be your only chance to copy the token, so make sure to save a copy in a safe place.

Have questions, need support, or want to contribute? Use GitHub Issues to report bugs and feature requests.

Known Limitations or Issues

  • Currently, due to dependencies on .NET MAUI Graphics or FigmaSharp, the tool does not generate vectors or custom fonts.
  • While it will be fixed soon, you currently need to set the root node in Figma to position 0,0.

Code released under the MIT license.

Keep Exploring

Related Reading

More Articles