This project contains all react components needed for your development. You can build and distribute as npm package.
To start using it just add this project as dependeny:
// packages.json
"dependencies": {
"mylib-react-ui": "git@github.com:cristianoliveira/react-lib-boilerplate.git"
}
To have all elements in the correct style you must wrap your app with the MyLibTheme
component.
// App.js
import MyLibTheme from 'mylib-react-ui';
const App = () => (
<MyLibTheme>
<MyPageComponent />
</MyLibTheme>
);
ReactDOM.render(<App />, document.getElementById('app'));
Using the components
// FooButton.js
import { Button } from 'mylib-react-ui';
const FooButton = () => {
<div>
<Button>Click</Button>
</div>
}
export default FooButton;
This project also has a live style guide and usage documentation :). To install and run the Styleguidist server do:
npm install
npm run styleguide
Then open http://localhost:6060 in your browser. There you going to find all components and examples of use.
To run all tests execute:
npm run test
This project includes:
- Reactjs
- Babel
- Webpack 3.0
- Postcss
- Jest
- Eslint
- Styledist