Lumen’s native adapters for SwiftUI, Jetpack Compose, and React Native landed in late August, and Lumen 2.1 followed on August 29. The tempting way to build them would have been to port the web components one at a time. This post covers what Lumen shares across platforms instead, what each platform keeps for itself, and how one token document holds the design together.

Roles travel, DOM APIs don’t

The shared contract for a component is its semantic purpose, variants, sizes, state names, content rules, accessibility expectations, and token roles. Rendering, focus systems, gestures, navigation, and platform conventions stay in the adapter. The architecture guide states the boundary plainly: native adapters must not depend on the DOM, CSS class names, the Astro runtime, or WebViews.

Button shows how that works in practice. All three native adapters accept the same intents: primary, secondary, quiet, danger, and success. The SwiftUI LumenButton renders a SwiftUI Button and accepts the platform’s own ButtonRole. The Compose version renders a Material 3 Button and reports its loading state through stateDescription semantics. The React Native version renders a Pressable with a button accessibility role and state. One intent maps to three native controls, so each starts from its platform’s own focus, press, and accessibility behavior instead of an approximation of the web’s.

A shared contract cannot prove itself on another platform, though. Touch targets, VoiceOver and TalkBack semantics, Dynamic Type, and disabled behavior are verified separately in each adapter.

One token document

tokens/lumen.tokens.json is the canonical, platform-neutral foundation. It uses Design Tokens Community Group token types for semantic light and dark colors, spacing, radii, typography, motion, and elevation, plus a set of data-visualization colors. A color role looks like this:

json
{
  "surface": {
    "$description": "Default component surface.",
    "$extensions": {
      "com.santi020k.lumen": { "cssValue": "0 0% 100%" }
    },
    "$value": "#FFFFFF"
  }
}

Native adapters consume the hexadecimal $value. The web’s HSL channel value lives in a namespaced extension, so the CSS output keeps its exact values without asking every other platform to understand CSS.

pnpm run generate:platform-tokens turns that document into TypeScript for core and React Native, Swift Color and CGFloat values, Compose Color, Dp, and Sp values, and the published @santi020k/lumen-tokens JSON. Durations, easing curves, and elevation are generated for every native adapter as well. Names follow each language, so surface-muted becomes surfaceMuted in Swift, Kotlin, and TypeScript.

The generated files are committed, and the check mode fails when any of them is stale. It also fails when the light and dark palettes stop listing the same roles in the same order, and when a semantic color in the web stylesheet no longer matches the canonical value. A color change is a change to every platform, so it is made once and reviewed as a diff across all of them.

Native conventions first

Each adapter delivers the theme the way its platform expects.

In SwiftUI, the theme flows through the environment. Apply .lumenTheme(.light) near the root, and components read it through @Environment(\.lumenTheme), the same mechanism SwiftUI uses for its own environment values. The package installs through Swift Package Manager from the repository-root Package.swift, with no npm package or CocoaPod involved.

In Compose, LumenTheme { } maps the shared palette onto Material 3 and exposes the complete Lumen token object through LocalLumenTheme, a CompositionLocal. Applications that already own a Material theme pass its color scheme, typography, and shapes into the same LumenTheme call instead of nesting a second theme.

In React Native, one LumenProvider near the root supplies the theme, and no stylesheet or web runtime is required. Lumen also exports native adaptations of web behavior contracts, such as useDialog and useTabs. The browser hooks from @santi020k/lumen-react stay out: DOM focus, ARIA attributes, CSS, browser storage, and keyboard handling belong to the web adapter.

Same name, three idioms

The icon catalog shows the balance clearly. One manifest, icons/lumen.icons.json, generates a name-to-component map for React Native, a Swift LumenIconName enum with an asset catalog, and a Compose LumenIconName catalog with VectorDrawable resources. The artwork and the name are shared. The call site is native:

tsx
;<LumenIconButton name="settings" label="Settings" onPress={openSettings} />
swift
LumenIconButton(name: .settings, label: "Settings", action: openSettings)
kotlin
LumenIconButton(
    name = LumenIconName.Settings,
    contentDescription = "Settings",
    onClick = ::openSettings
)

The name is a string in React Native, an enum case in Swift, and an enum entry in Kotlin. onPress, action, and onClick are each platform’s own word for the same event, and Compose calls the accessible name a contentDescription because that is the term Android developers already use. Forcing one spelling on all three would make every platform slightly wrong.

The rule that is shared is the one that matters: icon-only controls always require a label, and standalone decorative icons omit it. Product artwork outside the catalog still has native escape hatches, such as an SF Symbol systemName in SwiftUI or an ImageVector in Compose.

What stays native

Lumen provides components that sit inside platform structures, not replacements for those structures. SwiftUI NavigationStack, List, scenes, toolbars, and WidgetKit timelines stay application-owned. So do Compose navigation, Scaffold, and lazy collections, and React Native routers, virtualized lists, and safe-area handling. A Lumen row inside a native List is reasonable. A Lumen replacement for a split view would have to reproduce restoration, deep links, keyboard routing, and window behavior, then keep pace with every OS release.

Support is tiered to match:

  • Colors, spacing, radius, typography, motion, and elevation stay synchronized across every adapter.
  • A universal primitive tier, made up of Theme, Text, Icon, Button, IconButton, Surface, TextField, Badge, Divider, and Spinner, is implemented in all three.
  • Cards, alerts, chips, progress, and disclosure controls are shared where the interaction maps cleanly.
  • Some components exist only where they belong: LumenRefreshControl in React Native, LumenFloatingActionButton in Compose, and LumenShortcutRecorder on Apple platforms.

Wear OS ships as a separate artifact so phone and tablet apps do not pick up wearable-only contracts.

Earning supported status

The web catalog stays the reference for design intent. It is not a list of 150 components that every platform must port. A native component counts as supported only once its public contract, accessibility behavior, tests, and usage documentation exist in that adapter. Recurring native layouts start as documented patterns, and a pattern becomes a public component only after at least two maintained consumers share its semantic purpose, state model, and accessibility behavior.

That bar also applies to evidence. Representative physical-device accessibility checks and active-consumer upgrades are tracked as open qualification work for the 2.x line, not described as finished.

Start with the foundations overview for the shared token model, then open the guide for your platform: Apple, Android, or React Native. When your product needs its own brand, override only the roles it owns: LumenColors.light.overriding(...) in SwiftUI, LumenMaterialColorOverrides in Compose, or a theme built from createLumenTheme in React Native. Every Lumen component keeps reading the same role names, so the change stays in one place.

Filed under

Design systemsDesign tokensSwiftUIJetpack ComposeReact Native

Share this post

Know someone who builds product interfaces? Send it their way.