Render React components to Figma.
- π‘ Inspired by react-sketchapp.
- π¨ Designed to create manageable design systems.
- π¦ Flexible layouts support with Yoga Layout
- β»οΈ Hydration support.
- βοΈ Built on Figma Plugin API.
Example of code:
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>
);
};You can use react-figma-boilerplate for creating own projects.
Install it with yarn:
yarn add react react-figma yoga-layout
Or with npm:
npm i react react-figma yoga-layout --save
import * as React from 'react';
import { render, subscribeOnMessages } from 'react-figma';
import { App } from './App';
figma.showUI(__html__, { visible: false });
figma.ui.onmessage = message => {
subscribeOnMessages(message);
};
render(<App />);import * as yoga from 'yoga-layout';
import { uiWorker } from 'react-figma';
onmessage = event => {
uiWorker({ yoga })(event);
};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>
);
};Whether you're helping us implement features, fix bugs or improve the docs, we'd love to have you as part of the community!
- You pump your knowledge about:
- React. Best way to figure out how React works - implementing custom renderer. In the project we operate with most advanced concepts: Reconciliation, Hooks etc.
- Figma Plugins creation.
- Yoga Layout
- RxJS
- Take a place at the contributors list. π
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):
Ilya Lesik π» |
Losev Yaroslav π» |
Vishnu Singh π» |
corrina π» |
Zachary Witt π» |
Abdelrahman Ashraf π» |
This project follows the all-contributors specification. Contributions of any kind welcome!
