Docyrus

InstantMessageComposeDialog

Bottom-sheet launcher for the InstantMessageComposer, wired to the Docyrus SMS / WhatsApp messaging API.

iOSAndroidExpo Go
Preview InstantMessageComposeDialog on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-instant-message-compose-dialog
Required Packages(2 packages)
pnpm add @tanstack/react-query @docyrus/api-client

A full-height bottom sheet with the InstantMessageComposer, wired through useDocyrusInstantMessageComposer. The form mounts only while the sheet is open, so the SMS / WhatsApp account queries only run while it is visible. A successful send shows a toast, calls onSent and closes the sheet. A QueryClientProvider must be mounted above it.

Phone value renderers and form fields open this dialog when you pass them a client (and no onSendMessage).

Usage

import { InstantMessageComposeDialog } from '@/components/docyrus-native/instant-message-compose-dialog';

<InstantMessageComposeDialog client={client} to={['+905551234567']} />

<InstantMessageComposeDialog
  client={client}
  channel="whatsapp"
  availableChannels={['whatsapp']}
  body="Your order has shipped."
  trigger={null}
  open={open}
  onOpenChange={setOpen} />

API Reference

PropTypeDefaultDescription
clientRestApiClient-Authenticated Docyrus REST client (required)
tostring[]-Pre-filled recipient phone numbers
bodystring-Pre-filled body
channel'sms' | 'whatsapp''sms'Initial channel
availableChannelsReadonlyArray<InstantMessageChannel>['sms', 'whatsapp']Channels in the switcher
triggerReactNode | null-Trigger node (default: message icon button); null renders none
openboolean-Controlled open state
onOpenChange(open: boolean) => void-Open state change callback
titlestring'Send message'Sheet title
disabledboolean-Disables the default trigger
onSent(result: DocyrusInstantMessageSendResult) => void-Called after a successful send
classNamestring-Trigger classes

Type Exports

TypeDescription
InstantMessageComposeDialogPropsProps

On this page