{"id":20289924,"url":"https://github.com/mtmeyer/create-react-figma-plugin","last_synced_at":"2025-04-11T10:58:53.155Z","repository":{"id":40830542,"uuid":"385828351","full_name":"mtmeyer/create-react-figma-plugin","owner":"mtmeyer","description":"A tool to get you started making Figma plugins with a React plugin UI","archived":false,"fork":false,"pushed_at":"2023-04-07T04:57:09.000Z","size":698,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T07:22:45.380Z","etag":null,"topics":["cli-tool","figma","javascript","react","rollup","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtmeyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-14T05:50:49.000Z","updated_at":"2025-03-17T07:40:13.000Z","dependencies_parsed_at":"2022-09-19T06:01:31.779Z","dependency_job_id":null,"html_url":"https://github.com/mtmeyer/create-react-figma-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmeyer%2Fcreate-react-figma-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmeyer%2Fcreate-react-figma-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmeyer%2Fcreate-react-figma-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmeyer%2Fcreate-react-figma-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtmeyer","download_url":"https://codeload.github.com/mtmeyer/create-react-figma-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381696,"owners_count":21094525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-tool","figma","javascript","react","rollup","typescript"],"created_at":"2024-11-14T15:05:30.892Z","updated_at":"2025-04-11T10:58:53.138Z","avatar_url":"https://github.com/mtmeyer.png","language":"TypeScript","readme":"# Create React Figma Plugin\n\n![](https://img.shields.io/npm/l/@mtmeyer/create-react-figma-plugin?style=for-the-badge)\n![](https://img.shields.io/npm/v/@mtmeyer/create-react-figma-plugin?style=for-the-badge)\n![](https://img.shields.io/npm/dm/@mtmeyer/create-react-figma-plugin?style=for-the-badge)\n\n![](img/header.svg)\n\nA tool to get you started making Figma plugins with a React UI \u003csup\u003e1\u003c/sup\u003e.\n\n_This tool is in currently in beta so please report any bugs or issues_ 🙏\n\n## Get started\n\nYou'll need to setup both your development environment and add the plugin to Figma in order to get developing your plugin.\n\n### Dev enironment\n\nTo create the project template, run the following command. It will create a new folder in the directory you're running the command from with the project template.\n\n```sh\nnpx @mtmeyer/create-react-figma-plugin\n```\n\nor for Typescript run the following command:\n\n```sh\nnpx @mtmeyer/create-react-figma-plugin --typescript\n```\n\nFollow the prompts in the CLI to generate the project. Then get the development server started.\n\n```sh\ncd project-name\nnpm run dev\n```\n\nThe development server is now running and the plugin is ready to be added to Figma for development.\n\nNote: The development server also serves the plugin UI on http://localhost:5000/ to make tweaking the UI far more efficient. [More info in Development Workflow section](#Development-workflow)\n\n### Figma\n\nNow we will add the plugin to Figma for development. Note that this will not publish the plugin and it will only be visible to you.\n\n1. Open Figma\n2. Click on your profile icon dropdown in the top right and select `Plugins` from the list\n3. Scroll down to the `In development` section and click the plus(+) icon\n4. In the `Link existing plugin` section, click the box to choose your `manifest.json` file\n5. Locate the `manifest.json` in your newly created project and then select `Open`\n6. Now you will be able to use this plugin within a design file 🎉\n\nFor more information on developing plugins in Figma, see:\n\n- [Figma's Introduction to writing plugins](https://www.figma.com/plugin-docs/intro/)\n- [Figma Plugin API documentation](https://www.figma.com/plugin-docs/api/api-overview/)\n\n## CLI Options\n\n`@mtmeyer/create-react-figma-plugin` comes with the following options:\n\n- --javascript, --js - Create project with vanilla JavaScript\n- --typescript, --ts - Create project with TypeScript\n- --currDir, --currentDirectory - Creates project in current directory rather than creating a new directory.\n\n## SVG's\n\nIf you want to use svg's in your plugin UI, I recommend you use the 'import' syntax and add it into your JSX as a component.\n\n**Example**\n\n```javascript\nimport DopeIcon from \"./assets/dope-icon.svg\";\n\nconst App = () =\u003e {\n  return (\n    \u003cdiv className=\"container\"\u003e\n      \u003ch1\u003eHeading\u003c/h1\u003e\n      \u003cDopeIcon width={24} height={24} fill=\"#18a0fb\" /\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\n## Development workflow\n\nThe typical workflow for creating Figma plugins (in my experience) includes a lot of back and forth between the coding environment and Figma, constantly closing and opening the plugin. I've included a development server that runs the plugin UI on http://localhost:5000/ which can be run in the browser to help streamline this.\n\nYou will not be able to test anything which relies on Figma itself in this environment (e.g. `parent.postMessage`), it is only really useful for building the look and feel of your UI.\n\n### Quirks\n\nGiven these plugins are not meant to be run outside of the context of Figma, there are a few minor quirks when develping the UI in the browser.\n\n**Erros in the console:**\n\nYou will notice errors in the console which relate to Figma specific functions (e.g. `window.onMessage`) that you can call from the UI. This is not an issue as these should work when run in Figma (assuming the code is bug free of course 🤓)\n\n**Width \u0026 height:**\n\nFigma plugins run in a small UI with a set width and height much smaller than a browser window. To make sure what you're seeing in the browser is as close to how it will display in Figma as possible, set a width and height on the parent div of the UI which matches the dimensions you've set for the plugin UI.\n\nThe default width of Figma's plugin window is:\n\n```\nwidth: 300px;\nheight: 200px;\n```\n\nYou can set [custom dimensions for the plugin UI](https://www.figma.com/plugin-docs/api/figma-ui/), just make sure you match the width and height of the css container, with the plugin dimensions.\n\n---\n\n\u003csup\u003e1\u003c/sup\u003e Note: I am not affiliated with Figma, I just ❤️ the tool.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtmeyer%2Fcreate-react-figma-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtmeyer%2Fcreate-react-figma-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtmeyer%2Fcreate-react-figma-plugin/lists"}