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-haptics

Usage

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

PropTypeDefaultDescription
childrenReactNodeThe 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.
metastring–Small text under the last bubble of a run, such as a time or "Read".
lastbooleantrueWhether it ends a run from one person; only the last gets the tight corner and the meta.

TypingIndicator

PropTypeDefaultDescription
accessibilityLabelstring"Typing"Read out when it appears.