Skip to main content

Common Examples

To use the PromptBar, pass controlled value and onChange. The Send button stays disabled until onSend is wired. Sending is allowed when the draft has trimmed text, unless you override canSend.
The editor grows until maxRows (default 8), then it scrolls.

Stop

While isSending is true, sending is withheld. Wire onStop to surface Stop instead of Send.

Voice

PromptBar supports two distinct, mutually exclusive voice flows. A host uses one or the other, never both.

Dictation (speak → transcribe → insert)

The kit does not record or transcribe. Wire onStartVoice to show a mic. Drive voiceState ("idle", "listening", "transcribing") from the host. Pass audioLevel (0–1) while listening and transcript while transcribing. Wire onAcceptVoice and onCancelVoice to show those listening-row controls.

Live conversation

For a two-way spoken conversation, set isVoiceModeActive. The bar collapses to a single control that returns the user to typing — the editor, mic, and send are all withheld, because one input mode is active at a time. The input surface goes with them: with no editor to frame, the exit control sits bare on the page rather than inside the bar’s usual bordered, elevated pill. The spoken exchange renders as chat messages above, and the conversation’s own controls (mute, stop, collapse) live in the floating VoiceModeFab, not in the bar.
isVoiceModeActive and onExitVoiceMode are a required pair — the type will not let you set the flag without the handler. Collapsing the bar withholds the editor, mic and send, so a missing handler would leave the user with no route back to typing. The host ends the conversation and clears the flag.
If a host sets both isVoiceModeActive and a dictation voiceState, voice mode wins. That combination is a misconfiguration, but collapsing is the safer render: a listening row would offer an accept control that writes into an editor the user cannot see.
Attachments and the web waveform are not part of the React Native surface yet.

Disclaimer

Pass a plain-string disclaimer to show fine print under the bar. Omit it to hide the line. Rich-text and link support are not ported.

Disabled

disabled disables the editor, send, and mic.Built-in action labels (sendLabel, stopLabel, startVoiceLabel, and the voice-row labels) default to English. Override them for localized copy.

Accessibility

  • placeholder is the editor’s accessible name.
  • While listening, listeningLabel is announced through a polite live region because the level meter is decorative.
  • While transcribing, transcribingLabel names the row until transcript arrives.
  • Send, Stop, mic, accept, and cancel use the corresponding label props as accessible names.
Last modified on September 10, 2026