View as Markdown

API reference: @salmonui/chat/inline-assist

InlineAssistDictationPropstype

import type { InlineAssistDictationProps } from '@salmonui/chat/inline-assist';
type InlineAssistDictationProps = SpeechToTextButtonProps;

SpeechToTextButton props; the transcript is written into the prompt.

InlineAssistDictationProps members (18, 18 inherited)
NameSignatureDescription
childrenoptionalinheritedchildren?: ReactNode;

Visible label; without children the button is icon-only, named by localeText.label.

localeTextoptionalinheritedlocaleText?: SpeechToTextLocaleText;
variantoptionalinheritedvariant?: ButtonVariant;

Visual weight. Default 'solid' (or the group's).

toneoptionalinheritedtone?: ButtonTone;

Color role. Default 'neutral'; 'primary' for a floating button (or the group's).

sizeoptionalinheritedsize?: ButtonSize;

Metric set. Default 'md' (or the group's).

iconStartoptionalinheritediconStart?: ReactNode;

Decorative icon before the label (inline-start; follows dir).

iconEndoptionalinheritediconEnd?: ReactNode;

Decorative icon after the label (inline-end; follows dir).

floatingoptionalinheritedfloating?: boolean | ButtonFloatingPosition;

Floating action button: circular, elevated, positioned by CSS.

floatingScopeoptionalinheritedfloatingScope?: "parent" | "viewport";

'viewport' (default, position: fixed) or 'parent' (position: absolute in the nearest positioned ancestor).

refoptionalinheritedref?: Ref<HTMLButtonElement>;

The <button> (or the element render returns).

langoptionalinheritedlang?: string;

BCP 47 recognition language. Default: document.documentElement.lang, read when a session starts.

interimResultsoptionalinheritedinterimResults?: boolean;

Deliver interim (non-final) results. Default true.

continuousoptionalinheritedcontinuous?: boolean;

Keep listening after a pause until stop(). Default true.

recognizeroptionalinheritedrecognizer?: (() => SpeechRecognizer);

Replaces the browser recognizer, e.g. a cloud service. Called once per session.

onTranscriptChangeoptionalinheritedonTranscriptChange?: ((transcript: string, details: SpeechTranscriptDetails) => void);

The session transcript changed.

onStartoptionalinheritedonStart?: (() => void);

The recognizer started capturing audio.

onStopoptionalinheritedonStop?: (() => void);

The session ended (stop(), abort(), an error or the recognizer).

onErroroptionalinheritedonError?: ((error: SpeechRecognitionError) => void);

A recognizer error, or 'unsupported' when start() has no recognizer.