Render React components to Figma
npm install react-figma alt="React Figma logo by Lera Lesik" width="160" height="160">


A React renderer for Figma. Use React components as a source for your designs.
* ๐ฌ Compatible with react-native, react-sketchapp, react-primitives API.
* ๐ฆ Flexible layouts support with Yoga Layout.
* โป๏ธ Hydration and HMR support.
* โ๏ธ Built on Figma Plugin API.
* ๐ซ Is not a code generator.

Example of code:
``javascript
import * as React from 'react';
import { Page, View, Text } from 'react-figma';
export const App = () => {
return (
);
};
`
#### 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
#### Configure main thread
`javascript
import { setupMainThread } from 'react-figma/rpc';
figma.showUI(__html__, { visible: false });
setupMainThread();
`
#### Configure ui thread
`javascript
import * as React from 'react';
import { App } from './App';
import 'react-figma/rpc';
import { render } from 'react-figma';
render(
`
#### Import components
`javascript
import * as React from 'react';
import { Page, Rectangle, Text } from 'react-figma';
export const App = () => {
return (
);
};
``
* API Overview
+ render
+ Page
+ Frame
+ View
+ Text
+ Image
+ ...
* Styling
* Architecture
* Basic
+ Basic + HMR
* Design system
* Interactive
* UI - Interact with a Plugin UI
* Data fetching
* ๐
styled-components
* PrimerDemo - Example of multiplatform UI-kit
* Component Variants
* MDX
* Local Styles
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.
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.
React Figma team wishes to thank the following invaluable contributions:
* Lera Lesik, for creating project logo.
* Maksim, for TypeScript counseling.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!