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 one built-in Lumen theme to the root content view. The modifier shares semantic colors through the SwiftUI environment and sets the matching preferred color scheme for native controls, sheets, and system surfaces.
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.