NoiseSuppressionToggle wraps the SDK's noiseSuppression namespace with an accessible role="switch" control. Optimistic state with revert-on- error; renders a disabled "Not supported" state when the SDK reports the browser can't run the DSP (e.g. Safari < 17).
Install
pnpm add @levelchat/react-components @levelchat/webBasic usage
import { NoiseSuppressionToggle } from '@levelchat/react-components';
<NoiseSuppressionToggle />Capability detection
Never branch on navigator.userAgent here — trust the SDK's supportedflag, which checks the browser's AudioContext + AudioWorkletavailability at runtime. When unsupported, the switch is disabled with aria-describedby pointing at "Not supported in this browser".
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
renderLabel | (state) => ReactNode | "Noise suppression" | Override the label (i18n). |
hideStatus | boolean | false | Hide the descriptive text under the switch. |