Ai textarea

AI textarea with a send button and optional attachment and voice input buttons

Contents

Set showVoiceInputButton to add a microphone to the toolbar. Tap it and speak: dictation shows as grey preview text and commits to the form control when you confirm. Cancel discards the whole session.

The transcript is shown as the browser reports it. Thirty seconds without new speech ends the session and commits what you said; you can also cancel or confirm at any time.

The microphone only renders in Chrome (or Chromium) where the Web Speech API is available, so it does not appear in Firefox, Safari, or Edge.

This field starts with a value to show how dictation joins existing text at the caret.

Speech lands at the caret rather than always at the end, so click into the middle of the sentence before dictating to splice it in there.

Inputs in Voice input
showVoiceInputButton ?: boolean = false
Also set in this example
control : FormControl<string>
placeholder ?: string = ''
Outputs
onAttachmentsClick ?: any = new EventEmitter<void>()
onBlur ?: any = new EventEmitter<void>()
onFocus ?: any = new EventEmitter<void>()
onInputHandled ?: any = new EventEmitter<void>()
onSkip ?: any = new EventEmitter<void>()
onSubmit ?: any = new EventEmitter<void>()
onVoiceInputClick ?: any = new EventEmitter<void>()