Skip to content
Latestv1.0.63

AiVoiceTrigger ​

An intelligent voice interaction component that provides a sleek, float-over experience and supports custom audio waveform tracking to showcase multi-modal feedback.

Basic Usage ​

The simplest way is using v-model:recording to directly bind the recording state. Clicking on the mic triggers the visualizer panel.

Basic Usage

Dynamic Amplitudes Bar ​

Pass an array to amplitudes property dynamically during recording loop to visualize biometric traits or simulated multi-modal input. (Ideally bound to Web Audio API outputs)

Real-time Audio Simulation

Capturing Events ​

Listening to @start, @stop and @cancel can help you bridge the component exactly to your core WebSocket streaming API without data leakages. Text inside default slot will also append directly.

Trigger Callbacks

Practical Scenario: Voice Assistant ​

By combining the AiVoiceTrigger and AiBubble components, we can easily build a smart voice assistant interface featuring voice input, loading states, and responsive chat bubbles.

Application Scenario

API ​

Props ​

AttributeDescriptionTypeDefault
recording / v-model:recordingRecording state. Without binding the component manages its own state (uncontrolled). With v-model:recording it enters controlled mode and the visualizer auto-syncs with external changes.booleanundefined
amplitudesReal-time array determining the visualizer bars.number[][5,5,5,...]
theme-overridesFine-grained theme overridesComponentThemeVars—

Events ​

Event NameDescriptionParameters
update:recordingEmits state update back to model.(value: boolean)
startTriggered when active recording initiated.—
stopTriggered when users press the recording button again to submit.—
cancelUsers explicitly hit the dismiss key to discard audio chunk.—

Slots ​

Slot NameDescriptionParameters
defaultPlaceholder label text accompanying the minimal mic dot—

Use in Nuxt ​

This component fully supports Nuxt 3/4. In Nuxt projects, the component will be automatically imported.

For detailed configuration, please see Nuxt Integration.

Theme Variables ​

Variable NameDescriptionDefault Value
--yh-ai-voice-trigger-btn-sizeTrigger button size32px
--yh-ai-voice-trigger-active-colorActive color during recordingvar(--yh-color-danger)
--yh-ai-voice-trigger-wave-colorWaveform colorvar(--yh-color-danger)
--yh-ai-voice-trigger-bgPanel background colorvar(--yh-bg-color-overlay)

Released under the MIT License.