Fonts
Pika chooses the font families, but it never loads font files. Your app decides how the fonts arrive: self-hosted, from a font service, or not at all.
#What Pika uses
Light and dark modes use the same families:
Body (--p-font-sans) | Headings (--p-font-heading) | Monospace (--p-font-mono) |
|---|---|---|
| Geist | Inter | Geist Mono |
#How a font stack is built
Every stack has three parts, in this order:
--p-font-sans: p-sans, "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, …;
/* ↑ alias ↑ theme font ↑ system fallbacks */- A logical alias:
p-sans,p-headingorp-mono. Nothing is registered under these names by default, so the browser skips them. Register a font under one of them to replace that role everywhere, with no theme override. - Pika’s family: Geist, Inter or Geist Mono. This family is used when the page has loaded it or when it is installed on the device.
- System fallbacks: used when neither of the above is available, so text always renders.
Without any font setup, Pika renders in system fonts.
#Load the fonts
#Self-hosted (recommended for production)
Serve the font files yourself and declare them with @font-face, using the family names from the table above:
@font-face {
font-family: "Inter";
src: url("/fonts/Inter-Variable.woff2") format("woff2");
font-weight: 100 900;
font-display: swap;
}
@font-face {
font-family: "Geist";
src: url("/fonts/Geist-Variable.woff2") format("woff2");
font-weight: 100 900;
font-display: swap;
}Load only the families your app actually renders. An app that shows no code can skip Geist Mono.
#From Google Fonts
This is what this documentation site does:
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400..700&family=Geist+Mono:wght@300..700&family=Inter:wght@400;500;600;700&display=swap");Put it in your app’s global CSS. Keep in mind that it makes every page request a third-party origin.
#Use your own font
Register your font under the alias for the role you want to change. For example, to use your brand font for body text in both modes:
@font-face {
font-family: p-sans;
src: url("/fonts/Brand-Variable.woff2") format("woff2");
font-weight: 100 900;
font-display: swap;
}p-heading covers headings and p-mono covers code.
To change the font for only part of the page, override the variable instead:
<ConfigProvider themeOverrides={{ "--p-font-sans": '"Brand", system-ui, sans-serif' }}>
…
</ConfigProvider>#Check the font weights
Pika uses these weights:
| Token | Value | Used for |
|---|---|---|
--p-common-font-weight | 400 | Body text, buttons and controls |
--p-common-font-weight-strong | 500 | Emphasis, strong buttons |
Make sure the font you load provides these weights; a variable font covering 300–700 does. If your font lacks a weight, the browser synthesizes a fake bold or picks the nearest weight, so text can look heavier or lighter than intended. Adjust the tokens through themeOverrides if your font looks better at other weights:
<ConfigProvider themeOverrides={{ "--p-common-font-weight-strong": "600" }}>…</ConfigProvider>