Appica UIUI 1.0.0

Fonts

Swap the default system fonts for a local or Google font.


Typography in Appica UI is driven by two design tokens — --font-sans and --font-mono — exactly like colors and radii. Switching fonts is a two-part job: load the font in your app, then point the token at it. The first part is framework-specific; the second is one line of CSS that's the same everywhere.

The default fonts

Out of the box, @appica/ui-react/styles.css sets both tokens to native system font stacks:

System fonts download nothing, render instantly, and never cause layout shift — a good default. They feed Tailwind's font-sans / font-mono utilities through the @theme inline block, and Tailwind's preflight applies --font-sans as the base family for the whole document. So overriding the raw --font-sans token re-fonts your entire UI — every component included.

The one line that always applies

Whatever loads the font, you finish by redefining the raw token after the import, keeping a fallback stack so text stays readable while the web font loads:

globals.css

The font name on the left of the fallback list must match whatever the loading step below makes available — a font-family from @font-face, an @fontsource package, or the CSS variable next/font generates. The rest of this guide is just the different ways to get that name onto the page.

Loading the font

How you load a font depends on your framework. Next.js has a first-class font pipeline (next/font); everywhere else you self-host with Fontsource or a plain @font-face. All of these self-host the files, which is faster and more private than linking to a third-party CDN.

Next.js — next/font

next/font downloads the font at build time, self-hosts it, and hands you a CSS variable with zero layout shift. Use next/font/google for a Google font:

app/layout.tsx

…or next/font/local for font files you ship yourself:

app/layout.tsx

Either way, map the generated variable onto the Appica token:

app/globals.css

Vite, TanStack Start, React Router 7 / Remix — Fontsource

These bundlers have no built-in font helper, so self-host with Fontsource — one npm package per family, imported once:

pnpm add @fontsource-variable/geist
src/main.tsx
src/index.css

The font-family Fontsource registers is shown on each font's page — variable fonts use the … Variable suffix as above; static weights use the bare name ('Geist').

Any framework — local files with @font-face

If you'd rather not add a dependency, declare the face yourself and drop the files in your public/ (or static/) folder. This works in every framework, including Astro:

globals.css

The monospace font

--font-mono works identically — load the font, then redefine the token. It feeds font-mono, code blocks, and anything that opts into monospace:

Framework notes

The CSS override is identical everywhere; only the loading mechanism and where it lives change:

Whatever the source, the contract is the same: make a font-family name resolvable on the page, then put it first in --font-sans / --font-mono with the original stack trailing as a fallback.

Next steps

  • Theming — the token system fonts plug into.
  • Colors — recolor with the same override pattern.
  • Dark Mode — switch and persist themes.

© 2026 Appica UI. A free component library, crafted by the Appica team.