Basic Usage
With Attachment Options
Loading State
Disabled State
Props
Placeholder text for the input field.
Callback when message is sent (Enter key or Send button). Audio recordings are automatically converted to base64 WAV format.The callback receives an object with:
text(string, optional): The text message contentmedia(object, optional): Voice recording database64(string): Base64-encoded audiocontentType(string): Always “audio/wav”
Attachment menu options. When provided, shows a Plus icon button that opens a menu.Each option object:
id(string, required): Unique identifier for the optionlabel(string, required): Display text for the menu itemicon(ReactElement, optional): Icon to display before the label
Callback when an attachment menu item is clicked. Receives the option’s
id.Shows loading animation and disables input.
Disables the input field and buttons.
Standard onChange handler for the input field.
Callback when input receives focus.
Callback when input loses focus.
Callback for keydown events. Note: Enter key is handled internally to send messages.
Custom styles for the container.
Features
- Voice Recording: Click the microphone icon to start recording audio
- Waveform Visualization: Real-time audio waveform display during recording
- Audio Format: Recordings are automatically converted to base64-encoded WAV format
- Send on Enter: Press Enter to send text messages
- Dynamic Icon: Shows microphone when empty, send icon when text is present
- Recording Controls:
- Trash icon to cancel recording
- Send icon to submit the recording
- Attachment Menu: Optional Plus button with dropdown menu for additional actions
- Loading State: Shows Lottie animation when processing
- Auto-clear: Input clears automatically after sending