Mobile › Display
MessageBubble
Chat bubbles for your messages and theirs, with times and read receipts, plus a typing indicator.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { MessageBubble, TypingIndicator } from "plankui-mobile";
<MessageBubble from="them" last={false}>Are we still on for the review?</MessageBubble>
<MessageBubble from="them" meta="9:38">Thursday, 3 pm.</MessageBubble>
<MessageBubble from="me" meta="Read 9:41">Yes. I moved it to the big room.</MessageBubble>
<TypingIndicator />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The message. A string is drawn in the right colour for you. | |
| from | 'me' | 'them' | me sits on the right in the accent colour; them on the left in grey. | |
| meta | string | – | Small text under the last bubble of a run, such as a time or "Read". |
| last | boolean | true | Whether it ends a run from one person; only the last gets the tight corner and the meta. |
TypingIndicator
| Prop | Type | Default | Description |
|---|---|---|---|
| accessibilityLabel | string | "Typing" | Read out when it appears. |