warning icon  This site will be unavailable on Friday 21 February from 11:00AM to 5:00PM MST (1800 to 2400 UTC) for system maintenance.

Working with UI Designs in Figma®

Last modified by Microchip on 2025/02/03 14:56

What is Figma?

Figma® is a web-based design tool that is primarily used for interface design, prototyping, and collaboration. It allows multiple designers to work on the same project simultaneously, making it a popular choice for teams.

Figma is widely used in the tech industry for designing user interfaces for websites, mobile apps, and other digital products.

Figma Importer Feature in MGS Composer

The Figma Importer feature in MGS Composer facilitates the transfer of designs from Figma into MGS Composer for further development. This feature includes two components:

  1. Figma Exporter plugin for Figma
  2. Figma Importer feature within MGS Composer

Back to Top

MGS Composer Exporter (Plugin for Figma)

The Figma Exporter plugin allows a Figma user to select parts of their Figma design and export them as a ZIP archive to be imported by MGS Composer. This archive contains a JSON layout file, image assets, and SVG assets.

Back to Top

Installing the Plugin

To install the Figma Exporter plugin, navigate to the bottom toolbar in Figma and select Developer Mode by toggling the </> slider on the right.

Design Mode

Figure 1: Design Mode Toolbar - Toggle Off

Dev Mode

Figure 2: Design Mode Toolbar - Toggle On

Next, navigate to the right sidebar and select Plugins.

Figma Plug-ins

Figure 3: MGS Composer Plug-in

In the search field, enter "MGS Composer". Select MGS Composer – Exporter plugin when it appears.

An overview of the plugin will appear, along with a green Run button. Clicking this button runs the plugin, which should appear as a window docked to the right side of the Figma app.

Back to Top

Figma Exporter Archive

The Figma Exporter exports the design into an archive containing a JSON layout file, image, and SVG assets.

The layout file contains the structure of the Figma design as well as paths to the designs’ assets. For example, a Figma Design consisting of a frame containing two rectangles would produce a layout file that has a ‘frame’ object with two ‘rectangle’ children. Depending on the settings used during export, these rectangle objects might also contain filesystem paths to SVG assets indicating how they should be rendered.

Figma Design

Figure 4: Frame with Two Rectangles in Figma

JSON Output

Figure 5: Snippet of JSON Layout

Alongside the layout file are image (PNG) and SVG assets. These assets are referenced via filesystem paths in the layout file and are used during the MGS Composer import process to automatically produce finalized assets within MGS Composer itself.

Back to Top

Figma Importer (in MGS Composer)

The Figma Importer feature allows MGS Composer users to import a Figma design and automatically generate screens, widgets, and assets that reflect the Figma design as closely as possible.

Information

This feature is available in the MGS Composer version of the MGS Harmony gfx v3.16 package or newer.

The importer works by parsing the layout JSON from the exporter and translating the objects from Figma into their equivalents in MGS Composer. For example, the previous example of a Figma design with a frame containing two rectangles would end up as a Panel Widget containing a single Image Widget; this image would be a flattened picture of the two rectangles.

MGS Composer Screen Tree

Figure 6: Resulting widgets (tree) of exported Figma design

MGS Composer Design

Figure 7: Resulting widgets (design) of exported Figma design

Back to Top

Figma Export and MGS Composer Workflow

The high-level view of the process is as follows:

  1. A design is created in Figma. In this design are multiple ‘screens’, each representing a different GUI screen in MGS Composer.
  2. The Exporter plugin is used to export desired screens of the design.
    • A Figma page is selected to export from
    • Screens are chosen and generated into data (JSON and assets)
    • The data is exported to a ZIP archive
  3. MGS Composer imports the ZIP archive. Screens, widgets, and assets are created to closely reflect the original Figma design.

Steps 2 and 3 are repeated for every import process.

Information

Importing is one-directional and unique, meaning that if the same design is imported twice, new screens, widgets, and assets will be created with new names. The existing design will not be overwritten.

Back to Top

Tutorials

These tutorials guide you through the process of creating a UI design in MGS Composer from a Figma design.

Back to Top

Exporting a Design in Figma

This guide explains how to set up the Figma design and utilize the MGS Composer Exporter to create an export archive that can be imported into MGS Composer.

Back to Top

Importing and Optimizing the Design in MGS Composer

This guide shows how to import the design archive and to refine and optimize the GUI in MGS Composer.

Back to Top

Additional Information

This section provides additional information and guidelines on how to use the Figma import function in MGS Composer to accelerate the GUI development process effectively.

Back to Top