0.1.2 • Published 7 years ago

react-sand v0.1.2

Weekly downloads
9
License
-
Repository
-
Last release
7 years ago

NPM

Demo your components abilities. A simple component that wraps your components and gives component inputs to adjust their props.

:exclamation: Demo at gridiron.js.org (each component is wrapped with to allow playing with it)

Build Status codecov

NPM


Usage

import React, { Component, PropTypes } from 'react'
import sand from 'react-sand'

const Sand = sand({ React })

class FancyComponent extends Component {
  static propTypes = (
    { stringProp: PropTypes.string
    , numberProp: PropTypes.number
    , comboProp: PropTypes.oneOf([ 'foo', 'bar' ])
    }
  );
  render() {
    // RENDER SOMETHING
  }
}

export default props => (
  <Sand Box={FancyComponent}>
    <span>Some children</span>
  </Sand>
)

Output

In the example above you will see the FancyComponent rendered within a sandbox containing controls to alter its props in the browser.

Note: Under active development. This is not done yet. Pull requests welcome!

0.1.2

7 years ago

0.1.1

7 years ago