BASE

Primer React

Primer React

UI library · Free

GitHub design system React components for consistent, accessible application interfaces.

Also known as: primer/react

Resource illustration: Primer React

Open resource ↗

What you can use for free

Primer React code is available free of charge for local and commercial projects, subject to its license.

Paid features and costs

This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.

Access and limitations

Primer React code is available free of charge for local and commercial projects, subject to its license. This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.

Use cases

  • Interfaces using the GitHub design system
  • Components with documented states

Example workflow

A possible workflow; this is not a report of hands-on testing.

Interfaces using the GitHub design system with Primer React.

Before you start

  • A working React; Primer project and a specific use case: an interface using the GitHub design system.
  • A design, interface states, or dataset; target screens and accessibility requirements.

Steps

  1. Check the project's stack and version against the current Primer React documentation; add the package or the required source component.
  2. Implement the selected workflow with the supplied data, adapting styles and states to the project.
  3. Check the result in the target environment, remove sample data, and retain the notices required by the license.

Check your result

  • The example works in the chosen tech stack, including target dimensions and input errors.
  • Dependency size, keyboard behavior, and reduced motion suit the task; license terms are met.

Choosing Primer React

Interfaces using the GitHub design system

Choose this when

  • Interfaces using the GitHub design system
  • Components with documented states

Requirements

  • @primer/react, @primer/primitives, react, and react-dom are required, and the bundler must support importing CSS from JavaScript.

Things to consider

  • Costs and limits of free use: This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
  • Terms of use: MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.
  • Primer React does not provide polyfills or transpile code for older ECMAScript versions; a project supporting older browsers must handle these tasks.

Frequently asked questions

What can you use for free in Primer React?

Primer React code is available free of charge for local and commercial projects, subject to its license.

What additional costs might arise with Primer React?

This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.

What terms of use matter for Primer React?

MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.

How do you get started with Primer React?

Check the project's stack and version against the current Primer React documentation; add the package or the required source component. Implement the selected workflow with the supplied data, adapting styles and states to the project. Check the result in the target environment, remove sample data, and retain the notices required by the license.

What is needed for a basic Primer React theme?

The documentation adds ThemeProvider and BaseStyles at the root and imports theme CSS from @primer/primitives. Minimal configuration is enough for components; full @primer/css and markdown-body are needed separately for the relevant HTML/Markdown styling.

License

MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Technologies and topics

  • React
  • Primer
  • components

Sources

Other resources