Primer Brand is open-sourced on GitHub and available on npm.
Install Primer Brand with npm.
npm install @primer/react-brand
Primer Brand requires a global stylesheet to be loaded ahead-of-time.
Import the main
stylesheet at the earliest rendering opportunity:
import '@primer/react-brand/lib/css/main.css'
or
Load the static stylesheet if you're unable to import stylesheets using a bundler
<linkhref="https://unpkg.com/browse/@primer/react-brand@<version>/lib/css/main.css"rel="stylesheet"/>
Primer Brand references the Mona Sans
typeface, which will need to be loaded alongside the main stylesheet.
import '@primer/react-brand/fonts/fonts.css'
or
<linkhref="https://unpkg.com/browse/@primer/react-brand@<version>/fonts/fonts.css"rel="stylesheet"/>
You must add the ThemeProvider
to the root of your application for theming to work correctly.
E.g.
import {ThemeProvider} from '@primer/react-brand'function App() {return (<ThemeProvider><div>...</div></ThemeProvider>)}
Components can be imported into any React-based application.
E.g.
import {Hero} from '@primer/react-brand'
<Hero {...props} />