Skip to content

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.

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.

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.

  1. Create a personal access token (classic) on GitHub with read:packages.

  2. Add these lines to the .npmrc file in your project:

    @globalicons:registry=https://npm.pkg.github.com
    //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
  3. Put the token in the GITHUB_TOKEN environment variable. Never commit the token itself.

  4. 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.

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.

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.

Read the foundations in order. Colour and Accessibility matter most: they hold the rules every screen must meet.