GithubHelp home page GithubHelp logo

syyunn / plugin-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from figma/plugin-samples

0.0 1.0 0.0 565 KB

๐Ÿ”Œ Sample Figma plugins.

Home Page: https://www.figma.com/plugin-docs

TypeScript 53.04% HTML 20.07% CSS 3.85% JavaScript 18.08% Vue 4.96%

plugin-samples's Introduction

๐Ÿ”Œ Figma Plugin Samples

Sample plugins using the Figma Plugin API.

To make a feature request, file a bug report, or ask a question about developing plugins, check out the available resources.

These plugins are written using TypeScript to take advantage of Figma's typed plugin API. This means that in order to run a plugin, you will first need to compile the plugin code using the TypeScript compiler.

To install TypeScript, first install Node.js. Then:

$ npm install -g typescript

Now, to compile the Bar Chart sample plugin (for example):

$ cd barchart
$ tsc

Now you can import the Bar Chart plugin from within the Figma desktop app!

The code for each plugin is in code.ts in that plugin's subdirectory. If a plugin shows some UI, the HTML will be in ui.html.

For example, the code for the Bar Chart sample plugin is in barchart/code.ts, and the HTML for its UI is in barchart/ui.html.

Bar Chart

Generates a bar chart given user input in a modal.

Check out the source code.

Circle Text

Takes a single text node selected by the user and creates a copy with the characters arranged in a circle.

Check out the source code.

Document Statistics

Computes a count of the nodes of each NodeType in the current document.

Check out the source code.

Invert Image Color

Takes image fills in the current selection and inverts their colors.

This demonstrates:

  • how to read/write images stored in a Figma document, and
  • how to use showUI to access browser APIs.

Check out the source code.

Pie Chart

Generates a pie chart given user input in a modal.

Check out the source code.

Sierpinski

Generates a fractal using circles.

Check out the source code.

Text Search

Searches for text in the document, given a query by the user in a modal.

This demonstrates:

  • advanced message passing between the main code and the plugin UI,
  • how to keep Figma responsive during long-running operations, and
  • how to use the viewport API.

Check out the source code.

Vector Path

Generates a triangle using vector paths.

Check out the source code.

Webpack

Creates rectangles. Demonstrates bundling plugin code using Webpack.

Check out the source code.

React

Creates rectangles (same as the Webpack sample plugin).

This demonstrates:

  • bundling plugin code using Webpack, and
  • using React with TSX.

Check out the source code.

Vue

Creates rectangles (same as the Webpack sample plugin).

This demonstrates:

  • bundling plugin code using Webpack, and
  • using Vue Single File Components.

Check out the source code.

plugin-samples's People

Contributors

eng1amer avatar jyc avatar rudi-c avatar webong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.