Skip to content

🎪The simplest way to render a playground of React components

License

Notifications You must be signed in to change notification settings

batata-frita/lekplats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status npm version

Npm package to render a playground of React components.

Usage

The biggest difference between existing solutions is that this is just a React component.

yarn add --dev lekplats

Then render it passing a list of components with their fixtures:

import React from 'react'
import { render } from 'react-dom'
import Lekplats from 'lekplats'
import MyComponent from './components/MyComponent'

render(
  <Lekplats components={{
    Demo: {
      Component: MyComponent,
      fixtures: {
        'Swedish citizen': {
          name: {
            first: 'Sven',
            last: 'Svensson'
          },
          rolling: false
        },
        'Rolling Brasilian citizen': {
          name: {
            first: 'João',
            last: 'Silva'
          },
          rolling: true
        }
      }
    }
  }} />,
  document.getElementById('root')
)