# rn-instant-message-compose-dialog URL: /docs/native/docyrus/instant-message-compose-dialog Bottom-sheet launcher for the InstantMessageComposer, wired to the Docyrus SMS / WhatsApp messaging API. ## Installation ```bash pnpm dlx @docyrus/cli add @docyrus/rn-instant-message-compose-dialog ``` **Dependencies:** - [@tanstack/react-query](https://www.npmjs.com/package/@tanstack/react-query) - [@docyrus/api-client](https://www.npmjs.com/package/@docyrus/api-client) A full-height bottom sheet with the [rn-instant-message-composer](/docs/native/docyrus/instant-message-composer), wired through [`useDocyrusInstantMessageComposer`](/docs/native/hooks/use-docyrus-instant-message-composer). 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 [rn-value-renderers](/docs/native/docyrus/value-renderers) open this dialog when you pass them a `client` (and no `onSendMessage`). ## Usage ```tsx import { InstantMessageComposeDialog } from '@/components/docyrus-native/instant-message-compose-dialog'; ``` ## API Reference | Prop | Type | Default | Description | |------|------|---------|-------------| | `client` | `RestApiClient` | - | Authenticated Docyrus REST client (required) | | `to` | `string[]` | - | Pre-filled recipient phone numbers | | `body` | `string` | - | Pre-filled body | | `channel` | `'sms' \| 'whatsapp'` | `'sms'` | Initial channel | | `availableChannels` | `ReadonlyArray` | `['sms', 'whatsapp']` | Channels in the switcher | | `trigger` | `ReactNode \| null` | - | Trigger node (default: message icon button); null renders none | | `open` | `boolean` | - | Controlled open state | | `onOpenChange` | `(open: boolean) => void` | - | Open state change callback | | `title` | `string` | `'Send message'` | Sheet title | | `disabled` | `boolean` | - | Disables the default trigger | | `onSent` | `(result: DocyrusInstantMessageSendResult) => void` | - | Called after a successful send | | `className` | `string` | - | Trigger classes | ## Type Exports | Type | Description | |------|-------------| | `InstantMessageComposeDialogProps` | Props |