JDS.

Search docs

Find a page or component

Push to Talk

Hold to speak with pointer or the Space key. The ring grows with input level so users know they're heard.

Hold the button or Space

Installation

pnpm dlx shadcn@latest add @jds/push-to-talk

Usage

import { PushToTalk } from "@/components/voice/push-to-talk"

<PushToTalk onPressStart={mic.start} onPressEnd={mic.stop} level={mic.level} />

API Reference

PushToTalk

PropTypeDefault
onPressStart() => void–
onPressEnd

Also fires on window blur.

() => void–
level

Input loudness 0 to 1.

number0
hotkey

Space triggers, except while typing in a field.

booleantrue