Skip to content
Tutorials Center
My learning

Topics

Lesson 33 of 36 ยท Collaboration and Handoff

Exporting Assets and Plugins

Export PNG, JPG, SVG and PDF from Figma with scales and suffixes, prepare icons and images for the web, and automate work with plugins and the plugin API.

Designs eventually need to leave Figma as files: icons for an app, hero images for a website, a PDF for a client. Figma's Export settings let you define exactly what gets exported, and plugins let you automate repetitive work such as renaming layers or generating content.

Figma cannot run on this site. The code examples are labelled JavaScript stand-ins (a file-name generator and a mock plugin runner), and the plugin API snippets are read-only, shown for orientation. Check Figma's official plugin documentation before relying on any API detail.

The Export section

Select a layer, frame or slice and find Export at the bottom of the right panel. Click + to add an export setting. Each setting has:

  • Scale or size: 0.5x, 1x, 2x, 3x, 4x, or an explicit width (512w) or height (512h).
  • Suffix: text added to the file name, such as @2x.
  • Format: PNG, JPG, SVG or PDF (and WEBP in recent versions).

Add several settings to one layer to export all sizes in one go. Press the Export button, or select several layers and use File > Export. Figma saves a single file or a ZIP.

Which format to choose:

Format Best for Notes
SVG Icons, logos, simple illustrations Scales perfectly, small, can be styled with CSS
PNG UI screenshots, images with transparency Lossless; larger
JPG Photos Lossy, no transparency; set quality
WEBP Web photos and graphics Smaller than JPG/PNG; check your target support
PDF Print, documents Keeps vectors

Scales and file names

Mobile apps need multiple pixel densities. iOS uses @1x, @2x, @3x files; Android uses density folders (mdpi, hdpi, xhdpi, xxhdpi). The web often uses 1x and 2x with srcset. The stand-in below produces the file list for a given asset and setting list.

JS Stand-in: build export file names

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The layer name Icon / Search becomes icon-search. Naming layers with web-safe names from the start avoids cleaning file names later.

Slices and cropping

A slice (S) is an invisible export area you draw anywhere, independent of layers. Use slices to export a region of a design, to add padding around an icon, or to crop an image. Frames export with their clipped bounds, while a layer exports with its own bounding box (including strokes and effects such as shadows, unless you change the setting for stroke and effect inclusion).

Preparing icons

  1. Draw icons on a fixed grid, for example a 24 by 24 frame with a 2 px padding.
  2. Outline strokes (Ctrl+Alt+O) if the icon must scale without stroke changes, or keep strokes if you will recolor in code.
  3. Flatten shapes into a single vector when possible, and remove hidden layers.
  4. Name each icon frame as icon/search, and make them components, so they can be swapped via instance swap.
  5. Export as SVG, and use currentColor fills in code for theming.

Exporting a whole page for developers

Frames marked in a section can be exported in batch with a single setting copied across them. Select multiple frames, set the export once, and press Export frames. For several pages, repeat per page or use a plugin.

Plugins

Plugins add features to Figma. Open Plugins from the main menu (or Ctrl+/ quick actions) and browse the Community. Popular categories: content (lorem ipsum and fake data), accessibility (contrast and color-blindness checks), bulk renaming, icon libraries, design-token export, and charts.

Choose plugins carefully: they run with access to your file. Prefer well-known publishers, read the permissions, and avoid installing anything on files with confidential work unless your organization allows it. Organizations can restrict plugins to an approved list.

Writing a simple plugin

Plugins are built with JavaScript or TypeScript and a manifest.json. A minimal manifest looks like this (read-only example):

JSON
{
  "name": "Rename Selection",
  "id": "000000000000000000",
  "api": "1.0.0",
  "main": "code.js",
  "editorType": ["figma"],
  "documentAccess": "dynamic-page"
}

And a code.js that prefixes the names of the selected layers:

JavaScript
const selection = figma.currentPage.selection;

if (selection.length === 0) {
  figma.notify("Select at least one layer");
} else {
  for (const node of selection) {
    node.name = "ui/" + node.name;
  }
  figma.notify(`Renamed ${selection.length} layer(s)`);
}

figma.closePlugin();

You create a plugin in the desktop app from Plugins > Development > New plugin, then run it from the Development submenu. Plugin code runs in a sandbox with access to the Figma document and a separate UI iframe if you need an interface.

A mock plugin you can run

The stand-in below runs the same renaming logic against fake nodes, so you can test the algorithm without Figma.

JS Stand-in: run the rename logic on mock layers

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Widgets, REST API and webhooks

  • Widgets are interactive objects placed on the canvas or FigJam boards (voting, timers, trackers).
  • The REST API reads files, images, comments and (with the right plan) variables from outside Figma using a personal access token. Use it for CI checks, documentation sites and asset pipelines.
  • Webhooks notify your server when a file is updated or a library is published.

Keep tokens secret and never paste them into shared files.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which export format is best for a scalable icon on the web?

    SVG is vector, tiny and scales without losing quality.
  2. 2. What does a slice do?

    Slices mark regions for export, useful for cropping and padding.
  3. 3. You need files named [email protected] and [email protected]. Which setting adds @2x?

    The suffix is appended to the file name; scale sets the size.
  4. 4. What is a sensible precaution before installing a plugin?

    Plugins can access your file contents, so trust matters.

Summary

  • Export settings combine scale, suffix and format; add several to produce all densities at once.
  • Use SVG for icons, PNG or WEBP for UI imagery, JPG for photos, PDF for print.
  • Slices export arbitrary regions; name layers with safe file names.
  • Plugins automate work using JavaScript and the Figma plugin API; vet them first.
  • The REST API and webhooks connect Figma to external tools.

Next: Project: Mobile Onboarding Flow