figma-plus / plugin-boilerplate

Kickstart your awesome Figma plugin with this boilerplate.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Figma Plugin Boilerplate

Kickstart your awesome Figma plugin with this boilerplate.


Features

  • Modern Javascript (ES6)
  • Tests using Jest
  • Transpiling using Babel and bundle using Rollup
  • Code formatting with Prettier

Code Demo

export default class ExamplePlugin {
  constructor() {
    this.options = [
      "Alert File Name",
      this.main.bind(this),
      null,
      { shift: true, option: true, key: "t" }
    ];

    const { figmaPlugin } = window;
    figmaPlus.createPluginsMenuItem(...this.options);

    window.examplePlugin = this;
  }

  main() {
    const { App, alert } = window;
    const fileName = App.getCurrentFileName();

    alert(fileName);
  }
}

Download & Development

$ git clone https://github.com/figma-plus/plugin-boilerplate
$ yarn install
$ yarn serve
$ yarn test

Build a Distribution Bundle

$ yarn build

You'll see your bundle inside dist directory. Follow the docs instructions to publish it.

License

This project is licensed under the MIT License

About

Kickstart your awesome Figma plugin with this boilerplate.

License:MIT License


Languages

Language:JavaScript 100.0%