Extract coordinates from targeted Figma nodes.
A simple plugin for quickly targeting nodes and extracting key positional data (X, Y, width, height) for use in other applications.
Built using The DataFace's Figma plugin template
- Prefix desired nodes with a uniform string (e.g.
COORDINATE.or#or@). - Once the plugin is initialized, enter that string in the search box (the default is
COORDINATE) and run the command. - The positional data will show up below in the plugin's UI as JSON. You can download the results directly using the download button in the top-right corner of the results box.
- src
- src/common/ : Sources that are intended to be used both by plugin and ui logical sides.
- src/plugin/ : Sources of the plugin logical side. Place everything that interracts with Figma here.
- src/ui/ : Sources of the ui logical side, a classical Vite + Svelte source base.
- scripts
- scripts/vite/ : Some custom vite plugins to assist inlining assets
- figma.manifest.ts - A module that exports Figma Plugin Manifest for the build scripts
- Clone this repository
- Install dependencies with
npm install - In Figma, go to
Plugins>Development>New Plugin...and follow the prompts - Copy the contents of
manifest.jsoninto thefigma.manifest.tsfile in this repository's root folder - Run
npm run devto build the plugin. This command will watch for changes and rebuild the plugin automatically, updating Figma's plugin instance with the changes. - To publish the plugin, run
npm run buildand upload the/distfolder to the Figma Developer Console
- Images must be either inlined SVGs or be small enough to be inlined as data URIs. Figma plugins are sandboxed and cannot load external resources, so assets must be inlined.
- This boilerplate uses Svelte for the UI, Vite for the build system, and TypeScript for type checking.
- The plugin is built to the
/distfolder, which is ignored by Git. This folder is what you upload to the Figma Developer Console when publishing your plugin.
