Founding price: $35, then $79.99 after 23:59 UTC on 4 November, then $79.99
Get ProTake a photo with the camera: permission and error states, a camera chooser, an optional countdown, a mirrored preview, retake, and a File result. Tracks stop as soon as the camera is not needed.
This item has no props to tune. Use the lens above to change theme, density, direction and more.
The page must be served over HTTPS (or localhost) for the browser to allow the camera. Set a Permissions-Policy: camera=(self) header if your site restricts it.
| Prop | Type | Default | Description |
|---|---|---|---|
onCapture | (file: File) => void | - | The photo. |
confirm | boolean | true | Ask "Use photo" before calling onCapture. |
facingMode | user, environment | user | Which camera to ask for first. |
mirror | boolean | true for user | Mirror the preview and the saved file. |
countdown | number | 0 | Seconds before the shutter. |
outputType, quality, fileName | image/jpeg, 0.92, photo | The saved file. |
The component ships with a Testing Library test (webcam-capture.test.tsx) that covers: its main behaviour, the keyboard path and the error or empty states.