Skip to content
Browse docs and components

Mic Selector

mic-selector

A microphone picker that asks for permission first, so devices show by name rather than as blanks, then stays current as headsets are plugged in and out. Hands back a deviceId for getUserMedia.

Responsive

Install

$npxshadcnadd@forme/mic-selector

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

MicSelector

A microphone picker that handles the part people forget: until the page has permission the browser lists devices without names, so this asks once — releasing the microphone straight after — and then names them. The list stays current as headsets come and go.

PropTypeDefaultDescription
valuestring | nullnullThe chosen deviceId, for getUserMedia({ audio: { deviceId: { exact: value } } }).
onValueChange(deviceId: string) => void—
labelstring"Microphone"
classNamestring—