内容简介:Render React components to Figma.
React Figma
Render React components to Figma.
-
:candy: Compatible with react-native , react-sketchapp API. -
:art: Designed to create manageable design systems. -
-
:recycle: Hydration support. -
⚙️ Built on Figma Plugin API .
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 yoga-layout-prebuilt
Or with npm:
npm i react react-figma yoga-layout-prebuilt --save
Usage
Configure main thread
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 />, figma.root);
Configure ui thread
import * as yoga from 'yoga-layout-prebuilt'; import { uiWorker } from 'react-figma'; onmessage = event => { uiWorker({ yoga })(event); };
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
- basic
- design-system
- interactive
- groups
- Primer Demo - Example of multifplatform UI-kit
Become a Contributor
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:
- Lera Lesik , for creating project logo.
- Maksim , for TypeScript counseling.
Contributors
:sparkles:
Thanks goes to these wonderful people ( emoji key ):
|
|
|
|
|
|
|
This project follows the all-contributors specification. Contributions of any kind welcome!
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
编程的修炼(中英双语)
[荷]Edsger W. Dijkstra / 裘宗燕 / 电子工业出版社 / 2013-7 / 79.00元
本书是图灵奖获得者Edsger W. Dijkstra在编程领域里的经典著作中的经典。作者基于其敏锐的洞察力和长期的实际编程经验,对基本顺序程序的描述和开发中的许多关键问题做了独到的总结和开发。书中讨论了顺序程序的本质特征、程序描述和对程序行为(正确性)的推理,并通过一系列从简单到复杂的程序的思考和开发范例,阐释了基于严格的逻辑推理开发正确可靠程序的过程。 本书写于20世纪70年代中后期,但......一起来看看 《编程的修炼(中英双语)》 这本书的介绍吧!