Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FoundationsApple

Theme

Provide generated semantic colors, spacing, radii, typography, motion, and elevation to native components.

Public API.lumenThemeApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

Native example

Use Theme

Mount the theme once near the application root. Read semantic roles from the native theme object instead of copying hexadecimal values into feature code.

Theme rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
AppContent()
    .lumenTheme(.light)

Reference

Public API

The primary shared and platform-specific options exposed by .lumenTheme.

APIValues or typeDefaultDescription
themeLumenTheme.lightSelects the active native color scheme.
contentViewRequiredProvides Lumen theme values to the descendant tree.

Native behavior

Design and accessibility

When to use it

Mount the theme once near the application root. Read semantic roles from the native theme object instead of copying hexadecimal values into feature code.

Accessibility

The active color scheme follows the platform environment unless the application chooses an explicit light or dark mode.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package