Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
AIReact Native

Stream message

Show an assistant reply with one concise status announcement.

Public APILumenStreamMessageReact Native

Native example

Use Stream message

Update statusLabel with the status, such as "Writing…" then "Done". Put message actions in actions and source citations in sources.

Stream message rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Stream message demo
tsx
import * as Clipboard from 'expo-clipboard'
import {
  LumenMessageActions,
  LumenSourceCitation,
  LumenStreamMessage,
  type LumenStreamStatus
} from '@santi020k/lumen-react-native'
import { View } from 'react-native'

export function AssistantReply({ status, text }: { status: LumenStreamStatus; text: string }) {
  return (
    <LumenStreamMessage
      actions={
        <LumenMessageActions copyValue={text} messageId="answer-1" onCopy={({ value }) => Clipboard.setStringAsync(value)} />
      }
      sources={
        <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
          <LumenSourceCitation href="https://lumen.santi020k.com/docs" label="Lumen docs" />
        </View>
      }
      status={status}
      statusLabel={status === 'streaming' ? 'Writing…' : 'Done'}
    >
      {text}
    </LumenStreamMessage>
  )
}
React Native
A reply with its stream status, copy and rating actions, and a source chip.

Reference

Public API

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

APIValues or typeDefaultDescription
status / statusLabel / labelstream status / announced text / accessible nameidle / required / AssistantUpdate statusLabel with the status, such as "Writing…" then "Done".

Native behavior

Design and accessibility

When to use it

Update statusLabel with the status, such as "Writing…" then "Done". Put message actions in actions and source citations in sources.

Accessibility

Announces the status label once per change; streamed text never announces.

Shared component

Available on other platforms

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives