Reference

Props and hook API for the Theme component.

useTheme()

Returns the current theme state and setters. Must be used within a <Theme> provider.

PropertyTypeDescription
seedstringCurrent seed color (hex)
variantVariantCurrent variant enum
colorMode'system' | 'light' | 'dark'Current color mode setting
resolvedDarkbooleanWhether dark mode is active
themeGeneratedThemeGenerated theme with light/dark tokens
setSeed(s: string | HTMLImageElement) => voidChange seed color or extract from image
setVariant(v: Variant) => voidChange variant
setColorMode(m: ColorMode) => voidSet color mode directly
cycleColorMode() => voidCycle system → light → dark

Root <Theme> props

Used when <Theme> is the outermost provider (no parent Theme in the tree).

PropTypeDefault
seedstring | HTMLImageElement#6750A4
variantVariantTONAL_SPOT
contrastnumber0
colorMode'system' | 'light' | 'dark'system
storageKeystring | nullmaterial-shadcn-theme

Nested <Theme> props

When <Theme> is rendered inside another Theme, it creates a scoped <div> with its own CSS variables.

PropTypeDefault
seedstring | HTMLImageElementrequired
variantVariantinherits parent
contrastnumber0
darkbooleaninherits parent
...divPropsHTMLDivElement props

Variant enum

Imported from material-shadcn. Controls how Material 3 derives the palette from the seed color.

ValueDescription
TONAL_SPOTBalanced, default Material 3 style
EXPRESSIVEVibrant, high-chroma palette
FIDELITYStays true to the seed color
VIBRANTBold, saturated tones
NEUTRALSubtle, desaturated palette
MONOCHROMEGrayscale only
CONTENTAdaptive to content colors
RAINBOWColorful, multi-hue spread
FRUIT_SALADPlayful, varied hues