Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
AIApple

Message actions

Copy, retry, and rate one message.

Public APILumenMessageActionsApple / 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 Vision · visionOS 1+

Native example

Use Message actions

Pass disabled while streaming; Copy stays available. Retry and rating only report intent.

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

struct AnswerActionsExample: View {
    @State private var rating: LumenMessageFeedback?

    var body: some View {
        LumenMessageActions(messageId: "answer-1", copyValue: "Install the package first.", retry: true,
                            onRetry: { id in print("Retry", id) }, feedback: $rating,
                            onFeedback: { id, value in print(id, value?.rawValue ?? "cleared") })
    }
}
Apple
Copy, retry and a good or bad rating under an assistant answer.

Reference

Public API

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

APIValues or typeDefaultDescription
messageId / retry / showFeedbackowning message / show retry / show ratingrequired / false / truePass disabled while streaming; Copy stays available.

Native behavior

Design and accessibility

When to use it

Pass disabled while streaming; Copy stays available. Retry and rating only report intent.

Accessibility

Named group; rating buttons expose selected state; copy results announce politely.

Shared component

Available on other platforms

React NativeAndroid / Compose Web
Apple docsSwiftUI package