Webcam
A webcam component that streams the user's camera with configurable resolution and optional audio. Supports ref forwarding and shows an error message when camera access fails.
Allow camera access to see preview
Install
Use Open-UI CLI or Shadcn CLI to install the component.
Open-UI CLI
Shadcn CLI
Usage
| Prop | Default | Description | Type |
|---|---|---|---|
| width | 640 | Video width in pixels. | number |
| height | 360 | Video height in pixels. | number |
| audio | false | Whether to request the microphone stream. | boolean |
| className | — | Additional CSS class for the <video> element. | string |
| containerClassName | — | Additional CSS class for the outer container. | string |