🚀 Launch Special — All 6 templates for $149 (save 34%)🚀 All 6 templates — $149 (34% off)VIEW PRICING →
md3-next
DocsShowcasePricing
Templates
6
Sign in

Theming

A single seed colour generates the full Material Design 3 token set for both light and dark modes.

How colour generation works

Under the hood, createMD3Theme uses Google's @material/material-color-utilities to derive tonal palettes from the HCT colour space. Each palette produces tokens at specific tone levels defined by the MD3 spec—e.g. primary is tone 40 in light mode and tone 80 in dark mode.

import { createMD3Theme } from "md3-next";

// One seed → full MD3 palette
const theme = createMD3Theme({ seed: "#006A6A" });

// Access raw tokens
theme.tokens.light.primary;          // hex string
theme.tokens.dark.primaryContainer;   // hex string
Choosing a seed colour

Your seed colour is your brand colour. The algorithm extracts its hue and chroma, then builds harmonious secondary and tertiary palettes automatically. A few examples:

#6750A4
#006A6A
#B82000
#1565C0
#2E7D32
Light, dark & system modes

Pass mode to createMD3Theme to set the initial preference. The MD3Provider resolves "system" at runtime using prefers-color-scheme. Users can switch at any time via setMode or toggleMode.

const { mode, setMode, toggleMode } = useMD3();

// mode is the resolved value: "light" | "dark"
// setMode("dark")  — explicit
// setMode("system") — follow OS
// toggleMode()      — flip light ↔ dark
Full token reference(showing light mode)
Primary
TokenDescriptionValue
primary

Primary brand colour

#6750a4

onPrimary

Text/icon on primary

#ffffff

primaryContainer

Lighter primary for containers

#e9ddff

onPrimaryContainer

Text on primary container

#22005d

inversePrimary

Primary for inverse surfaces

#cfbcff

Secondary
TokenDescriptionValue
secondary

Secondary colour

#625b71

onSecondary

Text/icon on secondary

#ffffff

secondaryContainer

Secondary container

#e8def8

onSecondaryContainer

Text on secondary container

#1e192b

Tertiary
TokenDescriptionValue
tertiary

Tertiary accent

#7e5260

onTertiary

Text/icon on tertiary

#ffffff

tertiaryContainer

Tertiary container

#ffd9e3

onTertiaryContainer

Text on tertiary container

#31101d

Error
TokenDescriptionValue
error

Error colour

#ba1a1a

onError

Text/icon on error

#ffffff

errorContainer

Error container

#ffdad6

onErrorContainer

Text on error container

#410002

Surface
TokenDescriptionValue
surface

Default surface

#fdf8fd

onSurface

Primary text on surface

#1c1b1e

surfaceVariant

Variant surface

#e7e0eb

onSurfaceVariant

Secondary text

#49454e

surfaceDim

Dimmed surface

#ddd8dd

surfaceBright

Bright surface

#fdf8fd

surfaceContainerLowest

Lowest container

#ffffff

surfaceContainerLow

Low container

#f7f2f7

surfaceContainer

Default container

#f2ecf1

surfaceContainerHigh

High container

#ece7eb

surfaceContainerHighest

Highest container

#e6e1e6

Other
TokenDescriptionValue
outline

Borders and dividers

#7a757f

outlineVariant

Subtle borders

#cac4cf

inverseSurface

Snackbar/tooltip bg

#313033

inverseOnSurface

Text on inverse surface

#f4eff4

shadow

Shadow colour

#000000

scrim

Scrim overlay

#000000

Typography scale

The MD3 type scale is mapped to MUI typography variants automatically:

MUI variantMD3 role
h1Display Large
h2Display Medium
h3Display Small
h4Headline Large
h5Headline Medium
h6Headline Small
subtitle1Title Large
subtitle2Title Medium
body1Body Large
body2Body Medium
buttonLabel Large
captionBody Small
overlineLabel Small
Want this pre-built?

Our templates come pre-configured with MD3Provider, theming, and fully styled layouts. Save hours of setup time.

View 6 Templates — from $29