Start here
Republic is a design system. It gives you colours, type, spacing, fonts and icons that work in light and dark, on desktop and on touch screens. Read this page first. It tells you which packages to install and how to load them.
Use the plain CSS if your page is HTML, a template or a sign-in screen. Add the Tailwind bridge if your app already uses Tailwind. React components arrive in phase 2.
The packages
Section titled “The packages”| Package | What it gives you |
|---|---|
@globalicons/republic-tokens |
Design tokens as CSS variables, JSON and TypeScript |
@globalicons/republic-css |
Base styles, type classes, focus ring, materials and a Tailwind bridge |
@globalicons/republic-fonts |
Fira Sans and Unbounded, self-hosted, with their @font-face rules |
@globalicons/republic-icons |
Icons as React components and as an SVG sprite |
@globalicons/republic-react |
React components. Not yet released: it arrives in phase 2 |
You do not need all of them. The CSS package loads the tokens for you, so most pages need only the CSS and the fonts.
Install
Section titled “Install”The packages are on GitHub Packages, not on the public npm registry. To install them you need a GitHub token with the read:packages scope.
-
Create a personal access token (classic) on GitHub with
read:packages. -
Add these lines to the
.npmrcfile in your project:@globalicons:registry=https://npm.pkg.github.com//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} -
Put the token in the
GITHUB_TOKENenvironment variable. Never commit the token itself. -
Install the packages:
Terminal window pnpm add @globalicons/republic-css @globalicons/republic-fonts @globalicons/republic-icons
In CI, give the job a token with read:packages and expose it as GITHUB_TOKEN.
Plain HTML
Section titled “Plain HTML”Load the fonts first, then the CSS. Add class="rp-root" to the element that should take Republic’s base styles. Usually that is <body>.
<link rel="stylesheet" href="node_modules/@globalicons/republic-fonts/dist/fonts.css" /><link rel="stylesheet" href="node_modules/@globalicons/republic-css/dist/all.css" />
<body class="rp-root"> <h1 class="rp-display-m">Department of Records</h1> <p class="rp-text-m">Your changes are saved.</p></body>With a bundler, import the same files by package name:
@import "@globalicons/republic-fonts/fonts.css";@import "@globalicons/republic-css/all.css";Base styles apply only inside .rp-root, so the CSS is safe to add to a page that has other styles. All Republic rules sit in the cascade layers rp.base, rp.components and rp.utilities. Your own CSS outside a layer always wins, without !important.
The page follows the reader’s light or dark setting. To force one, set data-theme="light" or data-theme="dark" on any element. See Theming and Density.
Tailwind
Section titled “Tailwind”Republic includes a Tailwind v4 bridge. It maps Republic tokens to utility names such as bg-raised, text-muted, rounded-card and font-ui. The utilities point at the --rp- variables, so they switch with the theme.
Start with the layer order, then import Tailwind, the fonts, the CSS and the bridge. The first line puts Tailwind’s utilities after Republic’s layers, so a utility such as text-xs or bg-raised wins over a Republic class on the same element. Without it, Republic’s layers come last and its classes win.
@layer theme, base, rp.base, components, rp.components, rp.utilities, utilities;@import "tailwindcss";@import "@globalicons/republic-fonts/fonts.css";@import "@globalicons/republic-css/all.css";@import "@globalicons/republic-css/tailwind.css";<div class="bg-raised text-muted rounded-card p-4">Department of Records</div>React components arrive in phase 2. Until then, use the CSS classes in your React markup and the icon components from @globalicons/republic-icons. See Icons.
Next steps
Section titled “Next steps”Read the foundations in order. Colour and Accessibility matter most: they hold the rules every screen must meet.