Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
LayoutApple

Surface

Compose content on semantic native backgrounds with shared padding and radius roles.

Public APILumenSurfaceApple / 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 Surface

Use surfaces to express hierarchy through semantic canvas, surface, muted, and strong roles. Do not hardcode a parallel set of background colors.

Surface rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenSurface(tone: .muted, padding: .lg) {
    LumenText("Workspace")
}

Reference

Public API

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

APIValues or typeDefaultDescription
tonecanvas · surface · muted · strongsurfaceSelects the semantic background role.
paddingnone · sm · md · lgmdApplies generated platform spacing.
radiusnone · sm · md · lgmdApplies a generated corner radius.
contentNative composition APIComposes or lays out the surface with native APIs.

Native behavior

Design and accessibility

When to use it

Use surfaces to express hierarchy through semantic canvas, surface, muted, and strong roles. Do not hardcode a parallel set of background colors.

Accessibility

A surface does not add an accessibility role by itself. Descendant controls and content retain their native semantics.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package