Skip to content

Commit bd4ac58

Browse files
authored
docs(readme): update @primer/react readme (#5762)
1 parent 4cd9148 commit bd4ac58

File tree

1 file changed

+51
-16
lines changed

1 file changed

+51
-16
lines changed

packages/react/README.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,67 @@
2222
</a>
2323
</p>
2424

25-
## Documentation
25+
## Getting started
2626

27-
Our documentation site lives at [primer.style/react](https://primer.style/react). You'll be able to find detailed documentation on getting started, all of the components, our theme, our principles, and more.
27+
To install `@primer/react` in your project, you will need to run the following
28+
command using [npm](https://www.npmjs.com/):
2829

29-
## Installation
30+
```bash
31+
npm install -S @primer/react @primer/primitives [email protected]
32+
```
3033

31-
Install @primer/react in your project with your package manager of choice:
34+
If you prefer [Yarn](https://yarnpkg.com/), use the following command instead:
3235

33-
```console
34-
npm install @primer/react
36+
```bash
37+
yarn add @primer/react @primer/primitives [email protected]
3538
```
3639

37-
```console
38-
yarn add @primer/react
39-
```
40+
This command will install three packages in your project:
41+
42+
- `@primer/react`: used to import and use all the components from Primer
43+
- `@primer/primitives`: used to include the design tokens from Primer
44+
- `styled-components`: used to style components
45+
46+
To learn more about how to use `@primer/react`, visit our documentation site at:
47+
[primer.style](https://primer.style).
4048

41-
## Roadmap
49+
## Usage
4250

43-
You can track our roadmap progress in the [Roadmap Project Board](https://github.com/primer/react/projects/3), see more detail in the [quarterly planning Discussions](https://github.com/primer/react/discussions?discussions_q=%5BRoadmap%5D), and find a [list of all the current epic tracking issues](https://github.com/primer/react/discussions/997).
51+
The `@primer/react` package provides components in React for the Primer Design System. To use a component, import it directly from the package:
4452

45-
## Contributing
53+
```tsx
54+
import {Button} from '@primer/react'
55+
56+
function App() {
57+
return <Button>Hello world</Button>
58+
}
59+
```
60+
61+
At the root of your application, you'll also want to include our
62+
`ThemeProvider` and `BaseStyles` components along with styles from the
63+
`@primer/primitives` package. For example:
64+
65+
```tsx
66+
// Import each of the themes you would like to use, by default we are including
67+
// the light theme below
68+
import '@primer/primitives/dist/css/functional/themes/light.css'
69+
import {BaseStyles, ThemeProvider} from '@primer/react'
70+
71+
function RootLayout() {
72+
return (
73+
<ThemeProvider>
74+
<BaseStyles>
75+
<App />
76+
</BaseStyles>
77+
</ThemeProvider>
78+
)
79+
}
80+
```
4681

47-
We love collaborating with folks inside and outside of GitHub and welcome contributions!
82+
## 📖 Documentation
4883

49-
> 👉 See [the contributing docs](contributor-docs/CONTRIBUTING.md) for more info on code style, testing, coverage, and troubleshooting.
84+
The documentation for `@primer/react` lives at [primer.style](https://primer.style). There, you'll find detailed documentation on getting started, all of the components, our theme, our principles, and more.
5085

51-
## New Component Proposals
86+
## 🙌 Contributing
5287

53-
We welcome and encourage new component proposals from internal GitHub teams! Our best work comes from collaborating directly with the teams using Primer React Components in their projects. If you'd like to kick off a new component proposal, please submit an issue using the [component proposal issue template](https://github.com/primer/react/issues/new?template=new-component-proposal.md) and we will get in touch!
88+
We love collaborating with folks inside and outside of GitHub and welcome contributions! If you're interested, check out our [contributing docs](contributor-docs/CONTRIBUTING.md) for more info on how to get started.

0 commit comments

Comments
 (0)