An open API service indexing awesome lists of open source software.

https://github.com/gridaco/figma-view

React figma renderer component
https://github.com/gridaco/figma-view

Last synced: 9 months ago
JSON representation

React figma renderer component

Awesome Lists containing this project

README

          

# figma-view
React figma renderer component

```
yarn add figma-view
```

## Backends
**html-backend**

draws figma document using standard html elements

**canvas-backend**

draws figma document on html5 canvas

**iframe-backend**

A simlpe figma embeding wrapper

## Usage

Basic usage
```tsx
import React from "react"
import FigmaView from "figma-view"

// with url
export default funtion (){
return Loading..>} cached/>
}

// with data json
export default funtion (){
return Loading..>} fromapi/>
}
```

Data from plugin api
```tsx
Loading..>} fromplugin/>
```

Data from rest api
```tsx
Loading..>} fromapi/>
// or.. by default the from api is set to true.
Loading..>}/>
```

Using Nodes
```tsx
import { Frame, Text, Autolayout } from "figma-view"

export function FigmaDesignMock(){
return (



This is a view made with figma-view



)
}
```

## Authentication
```tsx
import FigmaView, { FigmaAuthenticationProvider } from "figma-view"

const _figma_personal_access_token = process.env.FIGMA_PERSONAL_ACCESSTOKEN;

export default function (){
return (



);
}

// or with access token (not personal access token)
// issue of access token is not done by this package. you can use `@design-sdk/figma-oauth` for that.

export default function (){
return (



);
}

```

### Custom document provider (Proxy server)
You can host up your own proxy server for your needs with [figma-file-proxy-server](https://github.com/gridaco/figma-file-proxy-server)

### References
- [design-sdk](https://github.com/gridaco/design-sdk)