React
Follow these instructions to use Hover Design System components @hoverinc/design-system-react-web in a React application.
Installation
The following instructions assume you are using Yarn 1.x as a package manager.
NPM authentication
All system packages are currently distributed as private packages on npm. Therefore, before we can install @hoverinc/design-system-react-web, we need to configure npm to authenticate to the correct package registries.
These steps should be copied into your project's readme.md.
Create .npmrc
- Create an
.npmrcwith the following command - Copy the requested secrets from 1Password as prompted
npx @hoverinc/configure-npm -s hover
Install Hover Design System and its dependencies
-
Verify you have React version
16.8or greater installed -
Install @hoverinc/design-system-react-web and its
peerDependencies
yarn add @hoverinc/design-system-react-web @emotion/react@^11 @emotion/styled@^11 framer-motion@^8
Set up DesignSystemProvider
Components must be wrapped in DesignSystemProvider to work correctlyโwe
recommend wrapping your entire application.
This may differ depending on how your application is set up, but generally it should look like this:
Next.js
In a Next.js application, you can use a
custom App.
Customize theme (optional)
This should only be necessary for augmenting or adding components that Blueprint does not support. Any necessary customizations should be discussed with the design systems team so we can consider incorporating them upstream in @hoverinc/chakra-theme.
1. Create a custom theme file
2. Override built-in theme
Pass customTheme to DesignSystemProvider.