UI Components

StreamingMessageView

StreamingMessageView is integrated into the SDK. It replaces MessageText when isMessageAIGenerated marks a message as AI-generated.

It renders the message with a typewriter animation and manages the UI for you.

To override it, provide your own component through WithComponents:

import { WithComponents } from "stream-chat-react-native";

<WithComponents overrides={{ StreamingMessageView: MyStreamingMessageView }}>
  <Channel channel={channel}>{/* ... */}</Channel>
</WithComponents>;

Best Practices

  • Use isMessageAIGenerated to gate AI rendering explicitly.
  • Keep AI UI components in predictable locations to avoid layout jumps.
  • Render AITypingIndicatorView only when AI is active.
  • Provide a stop action (StopMessageStreamingButton) for long generations.
  • Use null for StopMessageStreamingButton only if you also provide another stop control.

Example usage

const isMessageAIGenerated = (message) => !!message.ai_generated;

const App = ({ children }) => (
  <Chat client={client} isMessageAIGenerated={isMessageAIGenerated}>
    {children}
  </Chat>
);

This renders any message with ai_generated: true using StreamingMessageView.

AITypingIndicatorView

AITypingIndicatorView is not rendered automatically. Import and render it as a child of Channel. It shows when AI state is:

  • AI_STATE_GENERATING
  • AI_STATE_THINKING

Example usage

const isMessageAIGenerated = (message) => !!message.ai_generated;

const App = () => (
  <Chat client={client} isMessageAIGenerated={isMessageAIGenerated}>
    <Channel channel={channel}>
      <MessageList />
      <AITypingIndicatorView />
      <MessageComposer />
    </Channel>
  </Chat>
);

This shows the indicator above MessageComposer when the AI state matches.

Props

Prop Description Type
channel Channel to read AI state from. Optional; defaults to the channel from the surrounding Channel context. Channel

StopMessageStreamingButton

StopMessageStreamingButton lets users stop AI generation. It replaces the SendMessage button when AI state is:

  • AI_STATE_GENERATING
  • AI_STATE_THINKING

To override it, provide your own component through WithComponents:

import { WithComponents } from "stream-chat-react-native";

<WithComponents overrides={{ StopMessageStreamingButton: MyStopButton }}>
  <Channel channel={channel}>{/* ... */}</Channel>
</WithComponents>;
Note:

To hide it entirely, set StopMessageStreamingButton to null in the same WithComponents overrides.

Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v9: <Your Question>