Skip to content

Voice Bar

The chat composer in voice mode: the transcript types in as you talk, attach sits on the left, mic and close on the right, and a strip of dots along the bottom edge rises behind the buttons with the voice and the agent.

On this page
Used for
  • Voice mode
  • Talk to an agent
  • Dictation
  • Mobile composer
  • Hands-free input

Examples

State
Size
Colours

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

state / level
"idle" | "listening" | "thinking" | "speaking" | "done" / number
Default"idle" / 0
Controlled by your app. state drives the dots, the placeholder and the status line; level is the voice loudness 0 to 1: the mic while listening (useMicLevel), the reply's output while speaking.
transcript / value / defaultValue / onValueChange
string / string / string / (v) => void
Default""
transcript: the words so far; new words type in and the line stays while the agent thinks and speaks. value: the text in the box, as in Chat Composer; at done, move the transcript here so send lights up.
onMic / onClose / onSubmit
() => void / () => void / (message: ComposerMessage) => void
The mic button (and Esc while listening): start or stop. The close button: leave voice mode. Enter or send; the bar never submits by itself.
onAttach / actions
(kind: "file" | "image" | "folder" | "link") => void / ReactNode
The + menu / extra buttons before close.
labels / size / dots
Partial<Record<state, string>> / "web" | "phone" / VoiceDotsProps
Defaultbuilt in / "web" / -
Placeholder and status line per state (defaults "Tap the mic and start talking", "Listening…", "Thinking…", "Speaking…", "Send it, or keep talking"). size: up to 640px, or up to 390px with a denser strip. dots: passed to the strip along the bottom edge (rows 6 web, 5 phone; dotSize, gap, colors, tint, pointer, ref).
composer / disabled / className
Partial<ChatComposerProps> / boolean / string
Anything else the composer takes (attachments, models, header) / disables every control / on the outer element.

Accessibility

  • A visually hidden status line says the state ("Listening…", "Thinking…") when it changes. The dot strip is decorative and hidden from screen readers.
  • The mic button is a toggle: it reports pressed while listening and is named Stop dictation, and Esc anywhere in the bar stops listening.
  • Close, attach and send are named buttons with tooltips, from the same parts as Chat Composer, and the text box keeps its label and Enter to send.
  • The transcript line is hidden from screen readers while it types in, so words are not read one by one; send the final text through value.

What it handles

  1. 01Turns the chat composer into voice mode: the placeholder says the state, the transcript types in word by word.
  2. 02Keeps + on the left and the mic and close on the right; send shows once there is text to send and the mic is off.
  3. 03Runs the dot strip edge to edge along the card's bottom, clipped by its radius and behind the toolbar, so the card stays the height of a composer.
  4. 04Puts the buttons in front of the dots with a solid round fill and a hairline ring, so the wave rises behind them and never shows through.
  5. 05Says the state in a status line for screen readers; the strip itself is hidden from them.
  6. 06Leaves speech, the agent and the microphone to your app: you pass the state, the level and the words.

States

First render
Nothing plays in
none
A new word
It fades up into the transcript line; the words before it stay put
280ms, ease out
State change
The placeholder and status line change at once; the strip blends
420ms, ease in and out
Send appears
It pops in once there is text and the mic is off
180ms, ease out
A button is pressed
The dots ripple out from under it, then the state your app sets takes over
1.1s, once
Pointer over the bar
The column under it is sucked up behind the buttons and text
spring (glide)
Reduced motion
Words appear at once and the strip holds still
none

Works with

When to use

When to use

  • Voice mode in a chat app: the person talks, the transcript types in, the agent answers.
  • Dictating a message on a phone, then sending it as text.
  • A hands-free composer where the state must show at a glance.

When not to use

  • Typing first, with model and mode menus: use Chat Composer.
  • A call screen with a large animated presence: use Voice Orb.
  • Just the strip under your own surface: use Voice Dots.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Voice Bar to my app and wire it to my own data.
  • I need voice mode in a chat app: the person talks, the transcript types in, the agent answers. Set that up with the Knowns UI Voice Bar.
  • Which Voice Bar props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "voice-bar" }) and search_docs({ query: "voice bar" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Voice Bar, or found something off? We read every message.