Skip to content

react-figma/react-figma

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

…ples/styled-components/ua-parser-js-0.7.33

Bump ua-parser-js from 0.7.28 to 0.7.33 in /examples/styled-components
39f56b6 1

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 4, 2021 23:33
December 13, 2019 19:30
February 7, 2023 10:41
October 26, 2019 13:50
January 8, 2020 14:15
August 13, 2019 00:14
August 23, 2019 12:17
November 4, 2021 23:33
November 18, 2019 16:01
December 9, 2019 20:40
January 10, 2020 10:45
January 24, 2023 12:16

React Figma

React Figma logo by Lera Lesik

npm version CircleCI

A React renderer for Figma. Use React components as a source for your designs.

Example of code:

import * as React from 'react';
import { Page, View, Text } from 'react-figma';

export const App = () => {
    return (
        <Page name="New page" isCurrent>
            <View>
                <View style={{ width: 200, height: 100, backgroundColor: '#dd55aa' }} />
                <Text style={{ color: '#ffffff' }}>text</Text>
            </View>
        </Page>
    );
};

Installation

Using boilerplate

You can use react-figma-boilerplate for creating own projects.

From scratch

Install it with yarn:

yarn add react react-figma

Or with npm:

npm i react react-figma --save

Usage

Configure main thread

import { setupMainThread } from 'react-figma/rpc';

figma.showUI(__html__, { visible: false });

setupMainThread();

Configure ui thread

import * as React from 'react';
import { App } from './App';

import 'react-figma/rpc';
import { render } from 'react-figma';

render(<App />);

Import components

import * as React from 'react';
import { Page, Rectangle, Text } from 'react-figma';

export const App = () => {
    return (
        <Page name="New page">
            <Rectangle style={{ width: 200, height: 100, backgroundColor: '#dd55aa' }} />
            <Text characters="text" style={{ color: '#ffffff' }} />
        </Page>
    );
};

Docs

Examples

Sponsoring

Become a backer and get your logo on our Readme on GitHub with a link to your site.

Become a sponsor and get your logo on our README on GitHub with a link to your site.

Contributing

Everyone is welcome to contribute. Whether you're helping us implement features, fix bugs or improve the docs, we'd love to have you as part of the community!

How to Contribute

Check out our Contributing Guide for ideas on contributing and setup steps for getting repository up and running on your local machine.

Acknowledgements

React Figma team wishes to thank the following invaluable contributions:

Tested with browserstack

Tested with browserstack

Contributors

Thanks goes to these wonderful people (emoji key):

Ilya Lesik
Ilya Lesik

💻
Losev Yaroslav
Losev Yaroslav

💻
Vishnu Singh
Vishnu Singh

💻
corrina
corrina

💻
Zachary Witt
Zachary Witt

💻
Abdelrahman Ashraf
Abdelrahman Ashraf

💻
sprashad
sprashad

📖
Vivian Lee
Vivian Lee

💻
macintoshhelper
macintoshhelper

💻
Pierre Grimaud
Pierre Grimaud

📖
Greg Westneat
Greg Westneat

💻
Marius Reimer
Marius Reimer

💻
szeko
szeko

💻
Jonathan Holmes
Jonathan Holmes

📖
不吃猫的鱼
不吃猫的鱼

💻
Darío Hereñú
Darío Hereñú

📖
Konstantin Popov
Konstantin Popov

📖
Utkarsh Singh
Utkarsh Singh

📖
mrkenneh
mrkenneh

💻
Anna Do
Anna Do

💻
Steven Petryk
Steven Petryk

💻
Thierry Charbonnel
Thierry Charbonnel

📖
Jack Oliver
Jack Oliver

📖
Marc Abramowitz
Marc Abramowitz

📖
fishtriangle
fishtriangle

💻
Carlos
Carlos

📖

This project follows the all-contributors specification. Contributions of any kind welcome!