Apple Theming
Apply semantic tokens, follow system appearance, and verify light and dark themes. Learn how with Lumen for Apple / SwiftUI.
Appearance
Choose and change the theme
Apply a named theme at the root to follow the system. A nested scope can pin one reading view to light or dark. Use the root modifier when the app owns the window appearance.
import LumenUI
VStack {
AppNavigation()
ArticleView().lumenThemeScope(.paper, scheme: .light)
}
.lumenThemeScope(.santi020k)WindowGroup {
AppRoot()
.lumenTheme(.light)
}@AppStorage("useDarkAppearance") private var useDarkAppearance = false
var body: some Scene {
WindowGroup {
AppRoot()
.lumenTheme(useDarkAppearance ? .dark : .light)
}
}Style with semantic roles
Use Lumen semantic colors through public components instead of styling each control independently. The selected theme also keeps SF Symbols, native controls, and presented views aligned with the same appearance.
Verify both appearances
- Preview every supported device family in light and dark appearances.
- Check sheets, menus, focus rings, and system controls as well as the main view.
- Test Dynamic Type, Increase Contrast, and VoiceOver in both themes.