@canonical/maas-react-components v1.28.1
MAAS React Components
Library of React components for use in MAAS UI projects.
It contains components that are either specific to, or only used in MAAS. General purpose components should be added to @canonical/react-components instead.
Storybook | Philosophy and guidelines
Getting started
Installation
npm install @canonical/maas-react-componentsor using yarn:
yarn add @canonical/maas-react-componentsAdd styles import to your app:
@import "@canonical/maas-react-components/dist/style.css";Development with maas-react-components
To see the changes you make to maas-react-components reflected in a consuming app immediately, follow these steps:
In the
maas-react-componentsdirectory, run the following command to create a symlink:yarn linkIn the consuming repository (e.g.,
maas-ui), run the following command to use the local version ofmaas-react-components:yarn link "@canonical/maas-react-components"Go back to
maas-react-componentsdirectory and run the following command to start the build process with the watch flag:npm run build:watchAs you make changes to
maas-react-componentsthey will be automatically built and reflected in the consuming app.
Creating a new component
Make sure to read our React Components Guidelines before you proceed.
Run the following command from the root of the project:
npm run create-component
The script will prompt you to enter details of the new component.
It will create a new directory and files based on the details you provided. New files will contain a basic setup for your new component, including a basic test and a storybook story.
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago