A library of user interface components for the Tupaia project.
In the package directory, you can run:
yarn storybookOr from the monorepo root:
yarn workspace @tupaia/ui-components storybookThis runs the Storybook app and pulls stories from the stories/ directory which have a .stories.js suffix.
The page will reload if you make edits.
Storybook is an open-source tool for developing UI components.
The components are mostly built on top of components from the Material UI (version 4) library.
- Use Styled Components to customise components.
- Import Material UI components with a
Muiprefix to when you need to disambiguate them from custom components. e.g.import { Button as MuiButton } from '@material-ui/core' - Avoid hard-coding children and allow them to be passed in as JSX as much as possible.
- Export components using named exports.