Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
AIApple

Message

Show one assistant or user chat message aligned to its sender.

Public APILumenMessageApple / 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 Message

Assistant messages sit on surface-muted at the leading edge; user messages sit on brand-soft at the trailing edge. Pass an avatar for multi-person threads.

Message rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulatorView dark appearance
swift
import LumenUI
import SwiftUI

struct ConversationExample: View {
    var body: some View {
        VStack(spacing: 12) {
            LumenMessage("Can you summarize the release?", from: .user)
            LumenMessage(from: .assistant) {
                Text("Lumen 6 adds AI surfaces and native parity.")
            } avatar: {
                LumenAvatar(fallback: "AI", size: .sm)
            }
        }
    }
}
Apple
One chat message row aligned to its sender, with an optional avatar on the outer side.

Reference

Public API

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

APIValues or typeDefaultDescription
from / avatarsender / optional leading contentassistant / noneAssistant messages sit on surface-muted at the leading edge; user messages sit on brand-soft at the trailing edge.

Native behavior

Design and accessibility

When to use it

Assistant messages sit on surface-muted at the leading edge; user messages sit on brand-soft at the trailing edge. Pass an avatar for multi-person threads.

Accessibility

Content stays in reading order; nested links and actions remain reachable.

Shared component

Available on other platforms

React NativeAndroid / Compose Web
Apple docsSwiftUI package