Create an app

This section will guide you through the process of creating a new app using the Uno Platform Figma Plugin and the Example App present by default in the Uno Platform Material Toolkit file, using the Uno Platform Figma Plugin.

Important

This page is assuming that the Design to Code section has been completed.

Development environment (Visual Studio or your favorite IDE)

Creating a new project using the Uno Platform requires a developer environment to be setup. The following guides will help setting up a development environment: Get Started with Uno Platform

Create a project

This simple tutorial will create a new project using the unoapp template. It's using the blank template augmented with Uno Material and Uno Toolkit using the XAML UI language.

Run the following command in a terminal to create a new project:

dotnet new unoapp -preset blank -toolkit true -theme material -o MyFirstAppFromFigma

Following steps will use Visual Studio, but any other IDE should work as well with minimal changes.

Step 1 - Open the solution, compile and run it

  1. Open the generated MyFirstAppFromFigma.sln solution in your favorite IDE
  2. In the top toolbar, select the platform you like as your startup project (following screenshots will use MyFirstAppFromFigma.Windows)
  3. Press F5 to run the app and ensure it builds correctly
  4. Locate the page MainPage.xaml in the MyFirstAppFromFigma library project
  5. Compile the project to ensure it builds correctly
  6. Switch to Figma (next section)

Step 2 - Make Figma generates the right XAML

  1. Go back to Figma, in the document you created in the Design to Code section.
  2. Open the plugin (more details in the Setup section)
  3. In Figma, select the 01. Login frame
  4. In the plugin, navigate to the Properties tab
  5. In the Page Name field, write MainPage
  6. Navigate to the Application subtab
  7. In the Application Name field, write MyFirstAppFromFigma
  8. Go back to the Export tab
  9. Click on the Refresh button
  10. Now click on the Copy button to copy the generated XAML to the clipboard

Step 3 - Paste the generated XAML into app project

  1. Go back to your IDE (Visual Studio in this example)
  2. Replace the content of the MainPage.xaml file with the generated XAML, from the clipboard
  3. Press F5 to run the app

Next steps

This tutorial has shown you how to create a new app using the Uno Platform Figma Plugin and the Example App present in the Uno Material Toolkit Figma document.

Use this documentation to understand how to use the plugin to generate code from your own Figma document.