Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
Shared
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Hooks
Resources
Mic Selector
A picker for the available audio input devices.
"use client";
import {
MicSelector,
MicSelectorContent,
MicSelectorEmpty,
MicSelectorInput,
MicSelectorItem,
MicSelectorLabel,
MicSelectorList,
MicSelectorTrigger,
MicSelectorValue,
} from "@/registry/default/shared/mic-selector";
/** Enumerating inputs needs microphone permission; the list is empty without it. */
export default function Particle() {
return (
<MicSelector>
<MicSelectorTrigger>
<MicSelectorValue />
</MicSelectorTrigger>
<MicSelectorContent>
<MicSelectorInput />
<MicSelectorList>
{(devices) => (
<>
<MicSelectorEmpty />
{devices.map((device) => (
<MicSelectorItem key={device.deviceId} value={device.deviceId}>
<MicSelectorLabel device={device} />
</MicSelectorItem>
))}
</>
)}
</MicSelectorList>
</MicSelectorContent>
</MicSelector>
);
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/mic-selector
Usage
import {
MicSelector,
MicSelectorTrigger,
MicSelectorContent,
MicSelectorInput,
MicSelectorList,
MicSelectorEmpty,
MicSelectorItem,
MicSelectorLabel,
} from "@/components/mic-selector";API Reference
| Export | Props |
|---|---|
MicSelector | Popover props, plus its own options |
MicSelectorTrigger | Button props |
MicSelectorContent | Command props, plus its own options |
MicSelectorInput | CommandInput props, plus its own options |
MicSelectorList | CommandList props, with some props omitted, plus its own options |
MicSelectorEmpty | CommandEmpty props |
MicSelectorItem | CommandItem props |
MicSelectorLabel | <span> attributes, plus its own options |
MicSelectorValue | <span> attributes |
Open the source under Manual above for the exact prop types.
On This Page