Typography

A list of typography tokens available in Cerberus.

Font Tokens

Cerberus provides a set of font tokens (theme.tokens.fonts) that define the font families used throughout the design system. These font tokens serve as the foundation for all text styles and typography decisions.

The quick brown fox jumps

display

Primary font reserved for display headings

var(--font-display, var(--font-poppins, sans-serif))

The quick brown fox jumps

sans

Primary font used for body and headings

var(--font-sans, var(--font-poppins, sans-serif))

The quick brown fox jumps

mono

Code font used for any code related scenarios

var(--font-mono, var(--font-recursive, monospace))

Font tokens are designed to be semantic and descriptive:

  • display - Primary font reserved for display headings (Poppins)
  • sans - Primary font used for body text and regular headings (Poppins)
  • mono - Monospace font used for code and technical content (Recursive)

Customizing Font Tokens:

Font tokens can be customized in two ways: at the Panda config level or through CSS custom properties.

Option 1: Panda Config Level

Override font tokens directly in your panda.config.ts file:

panda.config.ts
import {
createCerberusConfig,
createCerberusPreset,
} from '@cerberus/panda-preset'
export default createCerberusConfig({
presets: [createCerberusPreset()],
include: ['./app/**/*.{ts,tsx}'],
exclude: [],
theme: {
tokens: {
fonts: {
// Override existing tokens
display: { value: "Inter Display, sans-serif" },
sans: { value: "Inter, system-ui, sans-serif" },
mono: { value: "JetBrains Mono, Menlo, monospace" },
// Add new font tokens
brand: { value: "YourBrand Font, serif" },
},
},
},
})

Option 2: CSS Custom Properties

Font tokens reference CSS custom properties with fallbacks for flexibility:

  • Each token uses the pattern: var(--font-{name}, var(--font-{family}, {fallback}))
  • You can override fonts by setting the appropriate CSS custom properties in your application
:root {
--font-display: "Custom Display Font", sans-serif;
--font-sans: "Custom Body Font", system-ui, sans-serif;
--font-mono: "Custom Mono Font", Menlo, monospace;
}

Text Styles

Cerberus provides a comprehensive set of text styles that combine font families, sizes, weights, and spacing to create consistent typography patterns.

display Styles

The quick brown fox jumps

display/lg

used for large headlines to bring the most emphasis on a page - less than one sentence

fontSize: 3rem

fontWeight: 700

lineHeight: 120%

The quick brown fox jumps

display/md

emphasized headlines to draw attention to, less than one sentence

fontSize: 2.5rem

fontWeight: 700

lineHeight: 115%

The quick brown fox jumps

display/sm

bold text used in things like marketing cards, data viz etc

fontSize: 1.875rem

fontWeight: 700

lineHeight: 115%

heading Styles

The quick brown fox jumps

heading/2xl

large on page header such as age tiles etc. one sentence or less

fontSize: 2.625rem

fontWeight: 600

lineHeight: 120%

The quick brown fox jumps

heading/xl

use for things like section headers on a page etc

fontSize: 2.25rem

fontWeight: 600

lineHeight: 120%

The quick brown fox jumps

heading/lg

use for subsections of pages, up to one sentence

fontSize: 1.875rem

fontWeight: 600

lineHeight: 120%

The quick brown fox jumps

heading/md

emphasized subheads, cards etc

fontSize: 1.5rem

fontWeight: 600

lineHeight: 120%

The quick brown fox jumps

heading/sm

headings for body text or things like card titles etc

fontSize: 1.25rem

fontWeight: 600

lineHeight: 120%

The quick brown fox jumps

heading/xs

Use mostly as a subhead or body size text that is meant to be emphasized

fontSize: 1rem

fontWeight: 600

lineHeight: 125%

The quick brown fox jumps

heading/2xs

used in chips or small pieces of information that introduce main content (a heading for a list of names etc)

fontSize: 0.875rem

fontWeight: 600

lineHeight: 125%

body Styles

The quick brown fox jumps

body/lg

large body blocks - 1 paragraph or less

fontSize: 1.125rem

fontWeight: 400

lineHeight: 150%

The quick brown fox jumps

body/md

default body text size

fontSize: 1rem

fontWeight: 400

lineHeight: 150%

The quick brown fox jumps

body/sm

body text used in compact things like cards and other areas where information density is required

fontSize: 0.8125rem

fontWeight: 400

lineHeight: 125%

label Styles

The quick brown fox jumps

label/sm

default lable for things like radio buttons, input fields etc

fontSize: 0.75rem

fontWeight: 400

lineHeight: 120%

The quick brown fox jumps

label/md

For large input fields that are designated to be more ephasized, used in rare cases.

fontSize: 1rem

fontWeight: 400

lineHeight: 120%

button Styles

The quick brown fox jumps

button/md

Default size for buttons across the platform

fontSize: 1rem

fontWeight: 600

lineHeight: 100%

The quick brown fox jumps

button/sm

Used for small buttons, or other use cases where information density is important for actions.

fontSize: 0.875rem

fontWeight: 500

lineHeight: 100%

mono Styles

The quick brown fox jumps

mono/xl

Reserved for numbers and data visualization

fontSize: 2.625rem

fontWeight: 400

lineHeight: 100%

The quick brown fox jumps

mono/lg

Reserved for numbers and data visualization

fontSize: 2rem

fontWeight: 500

lineHeight: 100%

The quick brown fox jumps

mono/md

Reserved for numbers and data visualization

fontSize: 1.5rem

fontWeight: 500

lineHeight: 100%

The quick brown fox jumps

mono/sm

Reserved for numbers and data visualization

fontSize: 1.25rem

fontWeight: 450

lineHeight: 100%

The quick brown fox jumps

mono/xs

Reserved for numbers and data visualization

fontSize: 1rem

fontWeight: 400

lineHeight: 100%

Text Style Categories:

  • Display - Large headings for marketing and hero sections
  • Heading - Structured content headings (h1-h6)
  • Body - Main content text in various sizes
  • Label - Form labels and UI text
  • Button - Button text styling
  • Mono - Monospace text for code and technical content

How to Use Text Styles: Text styles can be applied using the textStyle prop on Text components or through PandaCSS:

// Using Text component
<Text textStyle="heading-lg">Large Heading</Text>
// Using CSS function
<div className={css({ textStyle: 'body-md' })}>Body text</div>

Customization:

  • Text styles are built from primitive font and sizing tokens
  • Override individual properties by extending the text style object
  • Create custom text styles following the same pattern for consistency