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
import io.github.heartcoolman.prism.core.PrismThemeBasic usage
By default it follows the system dark/light setting and uses the Apple brand.
PrismTheme {
// Tokens are now available: PrismTheme.colors.accent, PrismTheme.spacing.s4, …
App()
}Color scheme
Force a specific scheme with colorScheme.
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.
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:
Text("Title", style = PrismTheme.typography.largeTitle, color = PrismTheme.colors.accent)API
| Parameter | Type | Default | Description |
|---|---|---|---|
colorScheme | PrismColorScheme | if (isSystemInDarkTheme()) PrismColorScheme.Dark else PrismColorScheme.Light | Light or dark color scheme for the subtree. |
brand | PrismBrand | appleBrand | Brand override for accent/status colors and radius geometry. |
content | @Composable () -> Unit | — | The themed subtree. |
PrismColorScheme
| Value | Description |
|---|---|
Light | Light color scheme. |
Dark | Dark color scheme. |
PrismThemealso exposes the token accessor objectPrismTheme.*(colors,typography,spacing,radius,elevation,motion,dimensions,materials). See Styling.