Documentation Index
Fetch the complete documentation index at: https://docs.prism.byescaleira.com/llms.txt
Use this file to discover all available pages before exploring further.
Theming
PrismUI ships with a protocol-based theming system. Every component reads colors from the currentPrismTheme via the SwiftUI environment, so switching themes updates your entire UI in one line.
PrismTheme Protocol
All themes conform toPrismTheme, which resolves semantic ColorToken values to concrete SwiftUI Color instances:
PrismTheme Protocol
Built-in Themes
PrismUI includes four themes out of the box:| Theme | Description |
|---|---|
DefaultTheme | Apple HIG system colors — adapts to light/dark automatically |
DarkTheme | A dark-first palette with deeper backgrounds and lighter foregrounds |
HighContrastTheme | WCAG AAA–compliant high-contrast colors for maximum readability |
BrandTheme | A customizable brand-color theme that wraps your primary color |
Using a Built-in Theme
Custom Themes
Create your own theme by conforming toPrismTheme:
Custom Theme
PrismAutoTheme
PrismAutoTheme automatically switches between a light and dark theme based on the system appearance:
Auto Theme Switching
PrismThemeStore
PrismThemeStore is an @Observable class that manages theme state. Use it to let users switch themes at runtime:
Runtime Theme Switching
Reading Theme in Components
Access the current theme from the environment in any view:Reading the Theme
All PrismUI components read from
@Environment(\.prismTheme) automatically. You only need to access the environment directly when building custom components.