|
22 | 22 | </a> |
23 | 23 | </p> |
24 | 24 |
|
25 | | -## Documentation |
| 25 | +## Getting started |
26 | 26 |
|
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/): |
28 | 29 |
|
29 | | -## Installation |
| 30 | +```bash |
| 31 | +npm install -S @primer/react @primer/primitives [email protected] |
| 32 | +``` |
30 | 33 |
|
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: |
32 | 35 |
|
33 | | -```console |
34 | | -npm install @primer/react |
| 36 | +```bash |
| 37 | +yarn add @primer/react @primer/primitives [email protected] |
35 | 38 | ``` |
36 | 39 |
|
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). |
40 | 48 |
|
41 | | -## Roadmap |
| 49 | +## Usage |
42 | 50 |
|
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: |
44 | 52 |
|
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 | +``` |
46 | 81 |
|
47 | | -We love collaborating with folks inside and outside of GitHub and welcome contributions! |
| 82 | +## 📖 Documentation |
48 | 83 |
|
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. |
50 | 85 |
|
51 | | -## New Component Proposals |
| 86 | +## 🙌 Contributing |
52 | 87 |
|
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