⚛️ 一个用于 Figma 的 React 渲染器
一个用于 Figma 的 React 渲染器。使用 React 组件作为设计源。
代码示例:
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>
);
};你可以使用 React-figma-boilerplate 来创建自己的项目。
使用 yarn 安装:
yarn add react react-figma或使用 npm:
npm i react react-figma --saveimport { setupMainThread } from 'react-figma/rpc';
figma.showUI(__html__, { visible: false });
setupMainThread();暂无开放 Issues,或尚未同步最近议题。