Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/pinqy520/revas

Use React and CSS to build UI interfaces on canvas
https://github.com/pinqy520/revas

canvas flutter react react-canvas react-native reactjs yoga yoga-layout

Last synced: 23 days ago
JSON representation

Use React and CSS to build UI interfaces on canvas

Awesome Lists containing this project

README

        






npm version


Use React and CSS to build UI interfaces on canvas


Document | 中文文档 | Live DEMO | DEMO Code

## Install

``` bash
$ yarn add revas react
```
## Usage

### Render to a DOM
```jsx
import React from 'react'
import {render, View, Text} from 'revas'

render(

Revas
,
document.getElementById('container')
)
```
[![Edit purple-browser-h56ht](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/purple-browser-h56ht?fontsize=14&hidenavigation=1&theme=dark)

### Render to a DOM rendered by React
```jsx
import React from 'react'
import {render, View, Text} from 'revas'

export class Widget extends React.Component {
componentDidMount() {
this.app = render(

Revas
,
document.getElementById('container'),
this
)
}
componentDidUpdate() {
this.app.update()
}
componentWillUnmount() {
this.app.unmount()
}
render() {
return


}
}
```
[![Edit reverent-river-vbypp](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/reverent-river-vbypp?fontsize=14&hidenavigation=1&theme=dark)

### Render to a custom canvas api

- https://github.com/pinqy520/revas-wxgame-example
- https://github.com/pinqy520/revas-bytegame-example

## DEMO



## Other Framework
- Vue - [huruji/vuvas](https://github.com/huruji/vuvas) by [@huruji](https://github.com/huruji)