Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/airtoxin/react-showcase

Make it easy to create your own react component showcase site.
https://github.com/airtoxin/react-showcase

Last synced: about 9 hours ago
JSON representation

Make it easy to create your own react component showcase site.

Awesome Lists containing this project

README

        

# react-showcase [![Build Status](https://travis-ci.org/airtoxin/react-showcase.svg?branch=master)](https://travis-ci.org/airtoxin/react-showcase)

Make it easy to create your own react component showcase site.

## Install

`$ npm install --save react-showcase`

## Usage

```js
import showcase from 'react-showcase';

const myComponents = [Input, Button];
const showcases = myComponents.map(Component => {
const Showcase = showcase(Component);
reutrn
});

function App() {
return

{showcases}

}

ReactDOM.render(, document.getElementById('showcase'));
```

It shows...

![showcaseView.png](showcaseView.png)

## Api

### `showcase(Component)` function (default exported)

__return__: `Showcase` component

This function returns your `Component` wrapped by `Showcase` component.

### `defaultStyles` object (named exported)

If you want to override showcase component styles, this can be used for base styling.

### `Showcase` component

``

It has styles property to override showcase styles.

```js
import { defaultStyles } from "react-showcase";

const myStyles = Object.assign({}, defaultStyles, {
article: { border: "dashed 2px red" }
});

const Wrapped = showcase(MyComponent);
ReactDOM.render(
,
document.getElementById("showcase")
);
```

![](styledShowcase.png)

## License

MIT