figma-overlay
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

Figma overlay

NPM version GitHub license Support Support me

Figma overlay is a drop-in component to create an overlay over your website to compare it to it's figma counterpart

It works by grabbing the page/component svg from your clipboard and creating a floating image for you to drag around and compare, letting you move it per-pixel using the arrow keys and changing the opacity for easy comparison.

Figma overlay is a Web Component so it works with any framework

IntroductionInstallation

Introduction

In an effort to aid the gap between a Figma design and the implementation counterpart this tool aims to make it easier for developers to achieve pixel-perfect implementation of designs. The workflow consists on opening a figma design, selecting a component, right clicking it and selecting copy and finally selecting Copy as SVG

Once this is done, you can now go to your website running Figma-overlay and click the floating button sitting on the lower-left corner of your screen

And that's it! Now you can drag the overlay around, use the arrow keys to tune the position and the slider to change opacity and compare what you did against what you have to.

Installation

Figma overlay is a Web Component which means you can use it with any framework you like by importing it properly. This small guide will only cover how to add it to the browser and to Vite based projects, specifically with Vue. If you get it up and running with other setup and want to contribute, please make a PR to ammend the instructions.

With Vite

npm i figma-overlay

Then import the component

import FigmaOverlay from 'figma-overlay';

Add it to your html as follows.

<figma-overlay></figma-overlay>

And make sure to add figma-overlay as a Custom Element in vite.config.ts

...
plugins: [
  vue({
    template: {
      compilerOptions: {
        isCustomElement: tag => tag.includes('figma-overlay')
      }
    }
  })
],

In the browser

Add the script at the end of your body tag

<script src="https://unpkg.com/figma-overlay@latest"></script>

or

<script src="https://cdn.jsdelivr.net/npm/figma-overlay@1.0.7/dist/figma-overlay.umd.min.js"></script>

And then ideally place the component right after the body

...
<body>
	<figma-overlay></figma-overlay>
	...
</body>

Author

Figma-overlay © Pitu, Released under the MIT License.
Authored and maintained by Pitu.

GitHub @Pitu

Package Sidebar

Install

npm i figma-overlay

Weekly Downloads

4

Version

1.0.12

License

MIT

Unpacked Size

164 kB

Total Files

6

Last publish

Collaborators

  • itspitu