Skip to content

ThemeProvider ​

The root theme entry point. PrismTheme provides every Prism design token (colors, typography, spacing, radius, elevation, motion, materials) plus a Material3 base, so all Prism and Material3 controls resolve correctly. Wrap your app (or any rendered subtree) in it. See Styling for token details and brand overrides.

Import ​

kotlin
import io.github.heartcoolman.prism.core.PrismTheme

Basic usage ​

By default it follows the system dark/light setting and uses the Apple brand.

kotlin
PrismTheme {
    // Tokens are now available: PrismTheme.colors.accent, PrismTheme.spacing.s4, …
    App()
}

Color scheme ​

Force a specific scheme with colorScheme.

kotlin
import io.github.heartcoolman.prism.core.tokens.PrismColorScheme

PrismTheme(colorScheme = PrismColorScheme.Dark) {
    App()
}

Brand override ​

Pass a PrismBrand to override accent + status colors and radius geometry. The default is appleBrand.

kotlin
import io.github.heartcoolman.prism.core.tokens.appleBrand

PrismTheme(brand = appleBrand) {
    App()
}

Reading tokens ​

Inside any composable under PrismTheme, read tokens from the PrismTheme object:

kotlin
Text("Title", style = PrismTheme.typography.largeTitle, color = PrismTheme.colors.accent)

API ​

ParameterTypeDefaultDescription
colorSchemePrismColorSchemeif (isSystemInDarkTheme()) PrismColorScheme.Dark else PrismColorScheme.LightLight or dark color scheme for the subtree.
brandPrismBrandappleBrandBrand override for accent/status colors and radius geometry.
content@Composable () -> Unit—The themed subtree.

PrismColorScheme ​

ValueDescription
LightLight color scheme.
DarkDark color scheme.

PrismTheme also exposes the token accessor object PrismTheme.* (colors, typography, spacing, radius, elevation, motion, dimensions, materials). See Styling.

Released under the MIT License.