Usage

Setup

If you did not use Fela yet, I highly recommend reading through the whole documentation.
You should read the Usage with React guide and wrap your whole application with the <Provider> component provided by react-fela.
After setting up react-fela, you can simply import any Kilvin component and use it as is. They've all been created using the createComponent API.

Example

import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-fela'
import { createRenderer } from 'fela'
import { View, Box } from 'kilvin'

import presetWeb from 'fela-preset-web'

const renderer = createRenderer({
  plugins: [
    ...presetWeb
  ]
})

const mountNode = document.getElementById('stylesheet')

render(
  <Provider renderer={renderer} mountNode={mountNode}>
    <View style={{ backgroundColor: 'blue' }}/>
      <Box grow>
        Hello World
      </Box>
    </View>
  </Provider>,
  document.getElementById('app')
)

results matching ""

    No results matching ""