A HeroUI Native Pro template - HeroUI Chat, a mobile AI assistant with streaming Markdown replies, reasoning, tool calls with approvals, sources, attachments, a model selector, and a swappable chat backend.
Meet HeroUI Chat, the third template in the HeroUI Native Pro library and the first one built on the AI chat components from 1.1.0. It is a complete mobile AI assistant: a streaming conversation, a prompt composer with attachments and slash commands, reasoning and tool calls rendered inline, a chat history drawer, and a settings sheet. Every screen runs offline on a mock backend with no API keys. When you're ready, you replace a single line to connect it to your own server.
A drawer, a chat stack, and a modal, wired with Expo Router:
(drawer)/_layout): a sliding Drawer with your chats grouped by date, a New chat button, and the account avatar that opens Settings(drawer)/(chat)/index): the conversation screen, with a History button and a New chat button in a native header. On iOS 26 the header is transparent with Liquid Glass buttons and a soft scroll-edge effect; on Android it's a solid barsettings/index): a native page sheet with an account switcher, settings rows, and an animated appearance pickerA new chat opens with a strip of PromptSuggestion cards. Each one plays a scripted reply that shows off a different part of the chat UI:
| Suggestion | What the reply shows |
|---|---|
| Plan a weekend trip | Reasoning, then a Markdown answer with a table |
| Check the weather | Two tool calls in a group |
| Catch up on AI news | A network error with Try again, then web sources |
| Write a React hook | Code blocks with copy buttons |
| Email a report | A tool call waiting for your approval |
| Track an order | A failed tool call the assistant recovers from |
The thread is a ChatConversation with ChatMessage rows:
StreamMarkdown, with syntax highlighting in code blocks. remend closes half-written Markdown mid-stream so the reply never flashes broken syntaxLoader shows dots while waiting for the first chunkChatMessageActions add Copy, thumbs up and down, and Regenerate on the latest replyReasoning block reads "Thinking" while streaming, then "Thought for Ns". Bold titles in the reasoning text become ChainOfThought steps, with the current step highlightedChatTool card that shows streaming arguments, duration, input, output, and errors. Tools that need permission show an approval card with Approve and Reject, and declined calls are marked as such. A ChatToolGroup collects related calls under "Running N tools" or "Used N tools · N failed"ChatSources shows stacked favicons with an "N sources" trigger that expands into a row of ChatSource chips. Tap a chip to open the link, or long-press it for a previewThe composer is built on PromptInput:
BottomSheet with Camera, Photos, and Files. Each attachment appears right away as a ChatAttachment with upload progress, and removing one cancels its upload. Send waits for uploads to finish, and an attachment can be sent on its own/ opens a slash menu with /search, /think, /summarize, /translate, and /codeModelSelector opens as a bottom sheet with three demo models and an effort slider. The selection carries across chats and goes out with every requestChatListView lists chats by date and highlights the active one. Long-press a chat to delete it after a confirmation. The list has loading, error, and empty statesListGroup rows for account and app settings, with a working haptic feedback Switch and an animated Light / Dark / Auto picker. The other rows are placeholders for you to wire upAll data goes through a seven-method ChatBackend interface (lib/chat/chat-backend.ts): list conversations, load messages, stream a reply, generate a title, delete a conversation, record feedback, and upload an attachment. The template ships with two implementations:
lib/mocks/mock-chat-backend.ts): streams the scripted scenarios with simulated latency and serves seeded historylib/chat/ui-message-stream-transport.ts): connects to a Vercel AI SDK server (v5 and later) that returns toUIMessageStreamResponse. It handles multi-step tools, tool approvals, and reasoning signaturesChange backends in app/_layout.tsx with configureChat({ backend }). To use another provider, write a streamReply that maps its events to the template's stream chunks. BACKEND.md walks through each method and includes a server example. Attachment picking and accounts are mocked too, and nothing is saved on the device yet.
expo-fontHeroUI Chat uses native modules that aren't included in Expo Go, including the Markdown renderer (react-native-enriched-markdown), react-native-webgpu, and react-native-skia. You'll need an Expo development build: run npx expo run:ios or npx expo run:android after the install, rather than scanning a QR code with Expo Go.
Open the Templates page, find the AI Chat card, and hit Download to grab the Expo source. A HeroUI Native Pro license is required.