Component props
The rendered DeviceSelector component
Use DeviceSelector when you need device selection dropdowns only - for example, in a settings panel or preferences dialog. It does NOT include video preview or audio level monitoring.
When to use DeviceSelector vs DevicePreview:
Key Features:
Internal Device Management: The component internally creates and manages its own MediaDeviceManager and MediaDeviceTester instances. You don't need to provide these - just use the component.
Basic usage in a settings panel:
import { DeviceSelector, SelectedDevices } from '@hiyve/react-ui';
function SettingsPanel() {
const [devices, setDevices] = useState<SelectedDevices>({});
return (
<DeviceSelector
selectedDevices={devices}
onDeviceChange={setDevices}
showAudioOutput
persistSelection
/>
);
}
Compact horizontal layout:
<DeviceSelector
selectedDevices={devices}
onDeviceChange={setDevices}
orientation="horizontal"
compact
showAudioOutput={false}
/>
With custom labels for internationalization:
const germanLabels = {
camera: 'Kamera',
microphone: 'Mikrofon',
speaker: 'Lautsprecher',
testAudio: 'Audio testen',
refreshDevices: 'Geräte aktualisieren',
};
<DeviceSelector
selectedDevices={devices}
onDeviceChange={setDevices}
labels={germanLabels}
/>
DeviceSelector provides dropdown menus for selecting media devices.