Native guide: Watch and wearables
Build a focused wrist interface with one essential action, readable progress, short statuses, and compact metrics. Keep navigation and watch lifecycle in your application.
Set up a watch target
Release availability
These examples follow the Lumen 6 release plan. Confirm the matching Swift tag and Maven Central artifacts are published before pinning them. The source playgrounds can run from this checkout without a published package.
Apple Watch · watchOS 9+
Create or open a SwiftUI watchOS application target in Xcode. Add https://github.com/santi020k/lumen through File → Add Package Dependencies, then attach the LumenUI product to the watch target itself. Linking it only to the iPhone target does not expose it to the watch app.
Import LumenUI and apply .lumenTheme(.dark) to the root watch view. The eight LumenWatch* views compile only for watchOS; shared phone source must keep these views in the watch target or behind a platform condition.
Wear OS · Android API 30+
Create or open a Compose-enabled Wear app module. Set minSdk = 30, keep google() and mavenCentral() in the repository configuration, and add lumen-compose-wear only to that module. The artifact brings the shared Lumen foundations transitively.
Keep your app's Activity Compose dependency, Compose BOM, launcher activity, and watch manifest configuration. Use android.hardware.type.watch; the standalone-app manifest setting must match whether your app requires a phone companion.
LumenWearTheme defaults to dark and applies the shared LumenThemeScope: Lumen semantic values plus androidx.compose.material3 colors, typography, and shapes. Pass theme = LumenNamedThemes.Classic for a named appearance, darkTheme = false for light, or explicit values to override its palette.
Import the APIs from com.santi020k.lumen. Your app still owns any separate androidx.wear.compose.material or androidx.wear.compose.material3 provider and its Wear navigation controls; the Lumen scope does not configure those providers.
// Package.swift: dependency and product for your existing watch target.
.package(
url: "https://github.com/santi020k/lumen",
exact: "6.0.0"
)
// In that target's dependencies:
.product(name: "LumenUI", package: "lumen")// wear/build.gradle.kts: inside an existing Compose-enabled Wear app.
android {
defaultConfig {
minSdk = 30
}
}
dependencies {
implementation("com.santi020k:lumen-compose-wear:6.0.0")
// Keep the application's Activity Compose dependency and Compose BOM.
implementation("androidx.compose.foundation:foundation")
implementation("androidx.compose.runtime:runtime-saveable")
implementation("androidx.compose.ui:ui")
}The Swift dependency fragment belongs in your existing package manifest; Xcode-managed apps can use the package dialog instead. The Gradle fragment belongs in the Wear application module and keeps the versions already selected by its Compose BOM.
Build a complete watch screen
This small rounds counter combines five primitives for a primary action and its supporting progress, status, metric, and list row. Tap the central action to complete a round; after five rounds, the next tap resets it. Each example defines its state, imports, and content, with an explicit progress-ring size.
import LumenUI
import SwiftUI
@main
struct RoundsWatchApp: App {
var body: some Scene {
WindowGroup {
RoundsScreen()
.lumenTheme(.dark)
}
}
}
private struct RoundsScreen: View {
@State private var rounds = 0
private let goal = 5
var body: some View {
ScrollView {
VStack(spacing: LumenSpacing.md) {
LumenWatchStatus(
rounds == goal ? "Goal reached" : "Ready",
tone: rounds == goal ? .success : .neutral
)
LumenWatchProgressRing(value: Double(rounds), maximum: Double(goal)) {
LumenWatchActionButton(
rounds == goal ? "Reset rounds" : "Complete a round",
dimension: 88,
action: { rounds = rounds == goal ? 0 : rounds + 1 }
) {
LumenIcon(name: .plus, size: .lg)
}
}
.frame(width: 112, height: 112)
LumenWatchMetric("Completed", value: "\(rounds) / \(goal)")
LumenWatchListRow {
LumenText("Tap after each round", variant: .caption)
}
}
.frame(maxWidth: .infinity)
.padding(LumenSpacing.sm)
}
}
}package com.example.rounds
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.santi020k.lumen.LocalLumenTheme
import com.santi020k.lumen.LumenIcon
import com.santi020k.lumen.LumenIconName
import com.santi020k.lumen.LumenIconSize
import com.santi020k.lumen.LumenText
import com.santi020k.lumen.LumenTextVariant
import com.santi020k.lumen.LumenWearActionButton
import com.santi020k.lumen.LumenWearListRow
import com.santi020k.lumen.LumenWearMetric
import com.santi020k.lumen.LumenWearProgressRing
import com.santi020k.lumen.LumenWearStatus
import com.santi020k.lumen.LumenWearTheme
import com.santi020k.lumen.LumenWearTone
class RoundsActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
LumenWearTheme {
var rounds by rememberSaveable { mutableIntStateOf(0) }
val goal = 5
val colors = LocalLumenTheme.current.colors
Column(
modifier = Modifier
.fillMaxSize()
.background(colors.canvas)
.verticalScroll(rememberScrollState())
.padding(horizontal = 24.dp, vertical = 20.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp)
) {
LumenWearStatus(
text = if (rounds == goal) "Goal reached" else "Ready",
tone = if (rounds == goal) LumenWearTone.Success else LumenWearTone.Neutral
)
LumenWearProgressRing(
value = rounds.toFloat(),
maximum = goal.toFloat(),
modifier = Modifier.size(112.dp)
) {
LumenWearActionButton(
accessibilityLabel = if (rounds == goal) "Reset rounds" else "Complete a round",
onClick = { rounds = if (rounds == goal) 0 else rounds + 1 },
dimension = 88.dp
) {
LumenIcon(
LumenIconName.Plus,
contentDescription = null,
size = LumenIconSize.Lg
)
}
}
LumenWearMetric(label = "Completed", value = "$rounds / $goal")
LumenWearListRow {
LumenText("Tap after each round", variant = LumenTextVariant.Caption)
}
}
}
}
}
}For SwiftUI, replace the example app declaration when adding the screen to an existing app. For Android, use your own package name and register RoundsActivity as the Wear module's launcher activity, or move its setContent body into your existing activity.
The native scrolling container and content slots belong to the application. On Wear OS, LumenText and LumenIcon inherit the row or action's content color, and text follows the shared theme typography. Explicit text tones and icon tints override that inheritance. Move the example strings into your localization resources, use locale-aware value formatting, and persist real activity data separately from this screen's demonstration state.
For asynchronous work, set loading = true on Wear OS or loading: true on watchOS to block repeat activation while showing busy feedback. Localize Wear's loadingLabel string or SwiftUI's loadingAccessibilityValue, which accepts LumenTextContent. SwiftUI action names also accept .verbatim(runtimeLabel) for application-resolved copy or .localized(...) for localized content. The app starts and completes the actual work.
Keep compact settings on their own screen
Use a toggle for a boolean preference, a value stepper for a small integer range, and an action row for a secondary command. This separate settings screen owns both values and enables Reset settings only after a value changes.
import LumenUI
import SwiftUI
@main
struct WatchSettingsApp: App {
var body: some Scene {
WindowGroup {
WatchSettingsScreen()
.lumenTheme(.dark)
}
}
}
private struct WatchSettingsScreen: View {
@State private var reminders = true
@State private var goal = 5
var body: some View {
ScrollView {
VStack(spacing: LumenSpacing.md) {
LumenWatchToggle(
"Reminders",
isOn: $reminders,
detail: "Before each session"
)
LumenWatchValueStepper(
"Round goal",
value: $goal,
minimum: 1,
maximum: 20,
step: 1,
formatValue: { $0 == 1 ? "1 round" : "\($0) rounds" }
)
LumenWatchActionRow(
"Reset settings",
detail: "Restore demo defaults",
enabled: !reminders || goal != 5,
action: {
reminders = true
goal = 5
}
)
}
.padding(LumenSpacing.sm)
}
}
}package com.example.rounds
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.santi020k.lumen.LocalLumenTheme
import com.santi020k.lumen.LumenWearActionRow
import com.santi020k.lumen.LumenWearTheme
import com.santi020k.lumen.LumenWearToggle
import com.santi020k.lumen.LumenWearValueStepper
class WatchSettingsActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
LumenWearTheme {
var reminders by rememberSaveable { mutableStateOf(true) }
var goal by rememberSaveable { mutableIntStateOf(5) }
val colors = LocalLumenTheme.current.colors
Column(
modifier = Modifier
.fillMaxSize()
.background(colors.canvas)
.verticalScroll(rememberScrollState())
.padding(horizontal = 24.dp, vertical = 20.dp),
verticalArrangement = Arrangement.spacedBy(12.dp)
) {
LumenWearToggle(
label = "Reminders",
checked = reminders,
onCheckedChange = { reminders = it },
detail = "Before each session"
)
LumenWearValueStepper(
label = "Round goal",
value = goal,
onValueChange = { goal = it },
valueRange = 1..20,
step = 1,
formatValue = { if (it == 1) "1 round" else "$it rounds" }
)
LumenWearActionRow(
label = "Reset settings",
onClick = {
reminders = true
goal = 5
},
detail = "Restore demo defaults",
enabled = !reminders || goal != 5
)
}
}
}
}
}Use one app entry point when trying these examples: replace the rounds app with WatchSettingsApp, or register WatchSettingsActivity as the Wear launcher. In an existing app, route to the settings view or composition from your native navigation. The reminder toggle changes demonstration state; it does not schedule notifications, and persistence and synchronization remain application-owned.
SwiftUI uses bindings through isOn and value. Wear OS publishes changes through onCheckedChange and onValueChange; update your state in those callbacks. The value stepper normalizes reversed bounds, clamps its displayed value, treats a nonpositive step as one, and safely stops at either bound. Rendering an out-of-range input does not rewrite your stored value; only an enabled interaction requests a change.
ValueStepper adjusts an integer; LumenStepper represents workflow progress. Localize the control titles, decrementLabel, incrementLabel, and formatValue output, including singular/plural units. Leading action-row content is decorative, and the text names the action. Keep rotary routing and screen navigation in the app.
Choose a wearable primitive
These focused APIs complement the shared foundations. Watch targets do not inherit the complete phone component catalog. Each reference includes its platform API, accessibility guidance, and a captured watch example.
List row
Flexible content inside an application-owned scrolling container.
Action row
A compact text action with optional supporting detail.
Value stepper
A bounded integer adjustment with accessible controls.
On SwiftUI, a content-only LumenWatchListRow can use its trailing closure. When adding a leading or trailing slot, supply both slot closures; use EmptyView() for the unused slot. On Wear OS, those slots are independently optional.
Keep lifecycle and interaction in the app
Lumen supplies semantic presentation. Your app owns scrolling and paging, Digital Crown or rotary input, focus, navigation, haptics, notifications, data synchronization, permissions, background work, and health or safety decisions. A watch action calls your handler; it does not start a workout, timer, or background session automatically.
Always On and ambient state
On watchOS, LumenWatchProgressRing hides its decorative rings when isLuminanceReduced is true while retaining center content and its accessibility value. A loading LumenWatchActionButton uses a static hourglass instead of a spinner when Reduce Motion or reduced luminance is active. Keep the essential value readable without the ring.
These presentation changes do not schedule refreshes or provide privacy policy. On Wear OS, ambient-mode handling is application-owned; the components do not observe an ambient controller or automatically hide the progress ring.
Complications, widgets, and tiles
The application owns WidgetKit timelines, complication families, App Intents, deep links, and Wear tiles. LumenWidgetUI is a separate Swift product for lightweight widget presentation; use it in the widget extension instead of linking the full app catalog solely for text, icons, badges, compact stats, or determinate progress.
Run the source examples
These commands use the repository's local source. They do not establish App Store or Google Play availability for a watch app. Install Xcode with a watchOS simulator for Apple, or Android Studio with JDK 21, Android SDK 37, and a Wear emulator for Android.
# From the repository root, open the existing Xcode project.
open apps/playground-apple/LumenApplePlayground.xcodeproj
# Or capture all eight examples in an available watch simulator.
apps/playground-apple/scripts/capture-watch-component-screenshots.sh# From the repository root, with a Wear emulator or device connected.
./packages/compose/gradlew -p apps/playground-android :wear:installDebug
adb shell am start \
-n com.santi020k.lumen.playground.wear/.WearMainActivity \
--es component "Action button"In Xcode, choose the LumenWatchPlayground scheme and a watchOS simulator. Normal launch opens the component catalog. For a specific example or a repeatable capture, use Edit Scheme → Run → Arguments to add --component and one of Wearable action, Wearable progress, Wearable status, Wearable metric, Wearable list row, Wearable action row, Wearable toggle, or Wearable value stepper. The capture script launches all eight in sequence.
The Apple Watch and Wear OS playgrounds are for local testing only. The existing Apple and Android phone, tablet, and desktop playgrounds include a Wearables section for exploring wearable patterns; the shipped iPhone app excludes the Watch payload. Publishing either native watch app requires a separate future release decision.
For Android, select the wear run configuration in Android Studio. Normal launch opens a component directory and a local session with start, pause, manual progress, and reset controls. The component launch extra opens Theme, Action button, Progress ring, Status, Metric, List row, Action row, Toggle, or Value stepper directly. The theme and darkTheme extras select the initial appearance; appearance controls retain the example's state. If multiple devices are connected, choose the intended Wear target in Android Studio or set ANDROID_SERIAL before running the commands. The local session does not run a background timer or collect activity data.
Apple playground source · Android and Wear playground source
Verify on the wrist
Use the smallest supported screen as well as a larger watch. Check long translated labels, enlarged text, contrast, disabled actions, scrolling, and focus. Keep a single primary action and enough inset space to avoid clipping on a round display.
On Apple Watch, inspect VoiceOver order and labels, Larger Text, Reduce Motion, Increase Contrast, and the transition into Always On. On Wear OS, inspect TalkBack, font scaling, remove-animations settings, rotary focus and scrolling, and ambient transitions. Confirm that the progress value and status remain understandable without color or decoration.
The action is a native semantic button, progress values are clamped, and status meaning remains in text. App-authored slots still need appropriate accessibility semantics. Check that a progress ring around a button announces a useful range and a distinct action without duplicated labels.
Evidence scope
Simulator captures show appearance. They do not prove physical-watch readability, screen-reader announcements, rotary behavior, power use, or Always On usability. Verify those behaviors in your actual app and record the tested revision and device. The repository's older device matrix is historical evidence, not a current release requirement.
How to record accessibility evidence · Native device evidence history · Platform coverage and limits