Voice assistant card with a cube outline made of particles that shake like sound while the call is live, and a Start talking / End call button.
Set your access key from API keys as NEXTUI_TOKEN in .env.local and add the @nextui namespace below to components.json once. Then every item installs by name. Each install counts as a copy on a free account.
$pnpm dlx shadcn@latest add @nextui/voice-agent
1{2"registries": {3"@nextui": {4"url": "https://nextui.dev/r/{name}.json",5"headers": { "Authorization": "Bearer ${NEXTUI_TOKEN}" }6}7}8}
1"use client";23import { useState } from "react";4import { VoiceAgent } from "@/components/nextui/voice-agent";56export function Example() {7const [live, setLive] = useState(false);89return (10<VoiceAgent11active={live}12onActiveChange={(next) => {13setLive(next);14// start or stop your voice session here15}}16/>17);18}
| Prop | Type | Default | Description |
|---|---|---|---|
| title | ReactNode | "Voice assistant" | Heading at the top of the card |
| active | boolean | – | Controlled call state; leave out to let the card manage it |
| defaultActive | boolean | false | Starting call state when uncontrolled |
| onActiveChange | (active: boolean) => void | – | Called when Start talking or End call is pressed |
| level | number | – | Live voice level from 0 to 1, e.g. from an AnalyserNode; leave out for a simulated voice |
| className | string | – | Extra class on the card |
Sign in to see the code
Preview it freely. A free account copies code and prompts a few times a day.