Presentational React Components with a coherent API for developers
- Powerful component API
- Dedicated UI engineering workflow
- Documentation with React Storybook
- Powerful prototyping tool
$ yarn add @segment/react-ui-library
React Storybook will be used as a reference and documentation for most components.
yarn run storybook
Open http://localhost:9009/ to see the Storybook
Using the react-ui-library
should be fairly straightforward.
Install and then import whatever components you need:
import React from 'react'
import ReactDOM from 'react-dom'
import {
Button
} from '@segment/react-ui-library'
ReactDOM.render(<Button primary>I am using the UI Library!</Button>, document.getElementById('root'))
Read the Storybook for more documentation.
Be sure to update the package.json
version accordingly if you make changes.
Common workflow is to commit and then run npm version patch
.
Avoid breaking changes in patches.
$ npm version {patch,minor,major}
-
patch
:0.0.1
-
minor
:0.1.0
-
major
:1.0.0
- Create a new component in
/src/components/Comp.js
- Create a new test for your component
/src/components/Comp.test.js
- Create a new story in
/src/stories/Comp.js
with documentation and examples