React Native components (@agentimhq/react-native-ui) API
Generated from the source and its doc comments (sdk/react-native-ui/src/components.tsx, sdk/react-native-ui/src/files.tsx).
npm install @agentimhq/react-native-ui @agentimhq/client-react-nativeFunctions
Section titled “Functions”AgentIM
Section titled “AgentIM”function AgentIM(The client, the texts, the replaceable parts, who “I” am, how dates are shown and the theme (scheme: light, dark or the system’s; colors overrides any token).
AIBadge
Section titled “AIBadge”function AIBadge()The AI mark (EU AI Act art. 50): drawn next to every agent’s name and message, also under a replaced Message component.
ConnectionBanner
Section titled “ConnectionBanner”function ConnectionBanner()A line saying what the connection is doing (offline, reconnecting, waiting for network); nothing while connected.
ConversationList
Section titled “ConversationList”function ConversationList({ selected, onSelect, search = true }: { selected?: string; onSelect(convId: string): void; search?: boolean })The conversations, newest first, with a search field that filters by title and last message.
DefaultSteps
Section titled “DefaultSteps”function DefaultSteps({ steps, strings }: StepsProps)The default list of an agent’s steps (docs/en/design/chat-components.md).
DefaultInboxDetail
Section titled “DefaultInboxDetail”function DefaultInboxDetail({ item: i, inbox, strings, when: w, outcome, onOpen }: InboxDetailProps)The default details of an inbox item, with its actions.
function Inbox({ types, extraItems = [], renderItem, onOpen }: { types?: string[]; extraItems?: InboxItem[]; renderItem?(p: InboxDetailProps): ReactNode; onOpen?(convId: string): void })The approval inbox (docs/en/design/chat-components.md): tabs, search, the list, and one item’s details with its actions (on a phone, one after the other).
InboxBadge
Section titled “InboxBadge”function InboxBadge()How many items wait in the inbox.
ConversationSteps
Section titled “ConversationSteps”function ConversationSteps({ convId }: { convId: string })Steps an agent reports without tying them to a message (docs/en/design/chat-components.md).
MessageList
Section titled “MessageList”function MessageList({ convId, notices = [], onOpenThread }: { convId: string; notices?: Notice<ReactNode>[]; onOpenThread?(threadId: string): void })The messages in an inverted list (newest at the bottom, scroll up for older ones; Stream Chat does the same), in runs per sender with day separators, notices and “New messages”; a button brings you back down.
TypingIndicator
Section titled “TypingIndicator”function TypingIndicator({ convId, names }: { convId: string; names?: (ids: string[]) => string[] })Who is typing, by name (from the members).
Composer
Section titled “Composer”function Composer({ convId, onAttach }: { convId: string; onAttach?: () => Promise<string[] | undefined | null> })onAttach: the app’s own picker (expo-document-picker, react-native-image-picker, …) returns the paths to send; without it there is no attach button.
MemberList
Section titled “MemberList”function MemberList({ convId }: { convId: string })The conversation’s members; agents carry the AI mark.
HandoffNotice
Section titled “HandoffNotice”function HandoffNotice({ convId }: { convId: string })Says when an agent hands the conversation to a person, and when it is back.
function Chat({ convId, title, subtitle, notices, onAttach }: { convId: string; title?: string; subtitle?: string; notices?: Notice<ReactNode>[]; onAttach?: () => Promise<string[] | undefined | null> })A whole chat screen: header, status, messages, typing, composer. Wrap it in the app’s keyboard handling.
FileIcon
Section titled “FileIcon”function FileIcon({ type, size = 40 }: { type: string; size?: number })A page with a folded corner in the type’s colour, its label in white.
ImageViewer
Section titled “ImageViewer”function ImageViewer({ convId, message: m, thumb, strings, onClose }: { convId: string; message: Message; thumb?: string; strings: Strings; onClose(): void })The full-screen viewer of an image: the enlarged thumbnail, View original, Download, close (Android back closes it too).
ImageMessage
Section titled “ImageMessage”function ImageMessage({ convId, message: m, strings, mine }: { convId: string; message: Message; strings: Strings; mine: boolean })An image message: the thumbnail at its proportions (at most 240 × 240) with its caption and upload progress; pressing opens the viewer.
FileMessage
Section titled “FileMessage”function FileMessage({ convId, message: m, strings, mine }: { convId: string; message: Message; strings: Strings; mine: boolean })A file message: a card with the type’s icon, the name, the size and upload progress; pressing opens the file.
MessageProps
Section titled “MessageProps”interface MessagePropsWhat a message component gets: replace Message in components to draw messages your way.
MessageProps.message
Section titled “MessageProps.message”message: MessageThe message to show.
MessageProps.convId
Section titled “MessageProps.convId”convId: stringThe conversation (to read the message’s file).
MessageProps.mine
Section titled “MessageProps.mine”mine: booleanWhether I sent it (shown on the right).
MessageProps.first
Section titled “MessageProps.first”first: booleanWhether it starts a run of messages from the same sender (shows the name and avatar).
MessageProps.last
Section titled “MessageProps.last”last: booleanWhether it ends a run of messages from the same sender (shows the time).
MessageProps.time
Section titled “MessageProps.time”time?: stringThe formatted time to show, when it shows one.
MessageProps.strings
Section titled “MessageProps.strings”strings: StringsThe interface texts in the current language.
MessageProps.onRetry
Section titled “MessageProps.onRetry”onRetry(): voidSends a failed message again.
MessageProps.onDiscard
Section titled “MessageProps.onDiscard”onDiscard(): voidDrops a failed message.
MessageProps.onFeedback
Section titled “MessageProps.onFeedback”onFeedback(rating: 'up' | 'down'): voidRates an agent’s message.
MessageProps.onRespond
Section titled “MessageProps.onRespond”onRespond(blockId: string, r: { action?: string; values?: Record<string, unknown> }): voidAnswers a card block: a button action or form values.
MessageProps.onEdit
Section titled “MessageProps.onEdit”onEdit?(text: string): voidEdits my message (when it can still be edited).
MessageProps.onRecall
Section titled “MessageProps.onRecall”onRecall?(): voidRecalls my message for everyone.
MessageProps.onStop
Section titled “MessageProps.onStop”onStop?(): voidStops an agent’s streaming reply.
MessageProps.onReact
Section titled “MessageProps.onReact”onReact?(key: string, on: boolean): voidAdds (on) or removes my reaction (docs/en/design/messaging.md).
MessageProps.onOpenThread
Section titled “MessageProps.onOpenThread”onOpenThread?(): voidSet when the app shows threads: opens this message’s thread.
ConversationItemProps
Section titled “ConversationItemProps”interface ConversationItemPropsWhat a conversation list row gets: replace ConversationItem in components to draw rows your way.
ConversationItemProps.conversation
Section titled “ConversationItemProps.conversation”conversation: anyThe conversation (title, last message, unread count, members…).
ConversationItemProps.selected
Section titled “ConversationItemProps.selected”selected: booleanWhether it is the open conversation.
ConversationItemProps.onSelect
Section titled “ConversationItemProps.onSelect”onSelect(): voidOpens it.
ConversationItemProps.strings
Section titled “ConversationItemProps.strings”strings: StringsThe interface texts in the current language.
ConversationItemProps.time
Section titled “ConversationItemProps.time”time?: stringThe formatted time of the last message.
ConversationItemProps.me
Section titled “ConversationItemProps.me”me?: stringMy user id (for “You: …” previews and direct-conversation titles).
Components
Section titled “Components”interface ComponentsThe parts you can replace, passed as components to AgentIM.
Components.Message
Section titled “Components.Message”Message: ComponentType<MessageProps>Draws one message.
Components.ConversationItem
Section titled “Components.ConversationItem”ConversationItem: ComponentType<ConversationItemProps>Draws one conversation list row.
Components.Avatar
Section titled “Components.Avatar”Avatar: ComponentType<{ id?: string; name?: string; kind?: string; size?: number }>Draws an avatar from the id, name and kind (human or agent).
Components.Empty
Section titled “Components.Empty”Empty: ComponentType<{ text: string; hint?: string }>Draws an empty state (no conversations, no messages).
Components.Steps
Section titled “Components.Steps”Steps?: ComponentType<StepsProps>Draws an agent’s steps next to its reply (docs/en/design/chat-components.md).
Components.cardBlocks
Section titled “Components.cardBlocks”cardBlocks?: Record<string, ComponentType<CardBlockProps>>Your own card blocks, by type (x-…, docs/en/design/chat-components.md).
Components.formFields
Section titled “Components.formFields”formFields?: Record<string, ComponentType<FormFieldProps>>Your own form fields, by type: x-…, or a built-in one drawn your way (a native date picker for date).
CardBlockProps
Section titled “CardBlockProps”interface CardBlockPropsWhat your own card block gets.
CardBlockProps.block
Section titled “CardBlockProps.block”block: anyThe block as sent (type, id, data, fallback).
CardBlockProps.done
Section titled “CardBlockProps.done”done: booleanWhether it can’t be answered (any more) by this person.
CardBlockProps.respond
Section titled “CardBlockProps.respond”respond(r: { action?: string; values?: Record<string, unknown> }): voidAnswers it: an action or values (blocks with an id only).
CardBlockProps.strings
Section titled “CardBlockProps.strings”strings: StringsThe interface texts.
CardBlockProps.when
Section titled “CardBlockProps.when”when: WhenThe viewer’s locale, time zone and clock.
FormFieldProps
Section titled “FormFieldProps”interface FormFieldPropsWhat your own form field gets.
FormFieldProps.field
Section titled “FormFieldProps.field”field: anyThe field as sent (id, label, type, config, …).
FormFieldProps.value
Section titled “FormFieldProps.value”value: unknownIts value now.
FormFieldProps.onChange
Section titled “FormFieldProps.onChange”onChange(value: unknown): voidSets its value.
FormFieldProps.disabled
Section titled “FormFieldProps.disabled”disabled: booleanWhether it can’t be changed (sent, or not for this person).
FormFieldProps.error
Section titled “FormFieldProps.error”error?: stringThe message when its value is not valid.
FormFieldProps.strings
Section titled “FormFieldProps.strings”strings: StringsThe interface texts.
StepsProps
Section titled “StepsProps”interface StepsPropsWhat a replacement Steps gets.
StepsProps.steps
Section titled “StepsProps.steps”steps: Step[]The steps, in order.
StepsProps.strings
Section titled “StepsProps.strings”strings: StringsThe interface texts.
InboxDetailProps
Section titled “InboxDetailProps”interface InboxDetailPropsWhat a custom inbox detail gets.
InboxDetailProps.item
Section titled “InboxDetailProps.item”item: InboxItemThe item (a request, a draft, a hand-off, or yours).
InboxDetailProps.inbox
Section titled “InboxDetailProps.inbox”inbox: InboxStateThe inbox, to act: decide, answer, approveDraft, discardDraft, handBack.
InboxDetailProps.strings
Section titled “InboxDetailProps.strings”strings: StringsThe interface texts.
InboxDetailProps.when
Section titled “InboxDetailProps.when”when: WhenThe viewer’s locale, time zone and clock.
InboxDetailProps.outcome
Section titled “InboxDetailProps.outcome”outcome?: InboxOutcomeWhat happened to it here, once handled.
InboxDetailProps.onOpen
Section titled “InboxDetailProps.onOpen”onOpen?(convId: string): voidOpens its conversation in your app.