Skip to main content

Common Examples

To use the PromptBar, pass controlled value and onChange. Mode is derived from those inputs: idle when the draft is empty, draft when text or attachments are present, and transcribing when transcription.active is true.

Draft and send

Enter sends when sending is allowed. Sending is allowed when the draft has trimmed text or attachments, unless you override canSend. While isSending is true, sending is withheld. Wire onStop to surface Stop instead of Send.

Attachments

Pass attachments and wire onAddAttachment and onRemoveAttachment. Each attachment needs a stable id and name. thumbnailUrl fills the tile; without it, the tile shows the name.

Transcription

Wire onStartTranscription for the mic control. Set transcription.active to enter transcribing mode. Prefer a real MediaStream for the waveform:
Set transcription.error to replace the waveform with an error message. Confirm then dismisses the error and exits transcription.

Disclaimer

Omit disclaimer for the default Atlas notice. Pass { message, linkHref } to customize it, wrapping the linked span in <link>…</link>. Pass null to hide the line.

Disabled

disabled disables the whole bar.

Internationalization

PromptBar owns these localized strings:
  • ai-kit.promptBar.placeholder
  • ai-kit.promptBar.add
  • ai-kit.promptBar.removeAttachment
  • ai-kit.promptBar.speak
  • ai-kit.promptBar.cancel
  • ai-kit.promptBar.send
  • ai-kit.promptBar.stop
  • ai-kit.promptBar.done
  • ai-kit.promptBar.dismiss
  • ai-kit.promptBar.disclaimer
  • ai-kit.promptBar.opensInNewTab
Override placeholder or disclaimer.message on the component, or mount AiKitIntlProvider inside CartoTheme. removeAttachment receives {name}. Disclaimer messages parse as ICU, so escape {, }, and ' if they are literal.

React Accessibility

  • Controls expose localized accessible names for add, remove, speak, send, stop, cancel, done, and dismiss.
  • Attachment remove labels include the attachment name.
  • Disclaimer links that open in a new tab include a localized announcement.
Last modified on August 28, 2026