Description
react-webcam is a React component that shows a live webcam feed on your page and lets you take screenshots from it. You render the Webcam component and pass props such as audio, mirrored and videoConstraints to control the feed. Any other prop is passed to the underlying video element, so className and style work as they normally do. The onUserMedia callback runs when the component receives a media stream, and onUserMediaError runs when it cannot. Screenshot settings include the format, which defaults to image/webp, the quality, which defaults to 0.92, image smoothing, and minimum width and height. The README notes that browsers block the camera when a page is loaded from an insecure origin, so the page must be served over HTTPS. Browser support follows the getUserMedia-based webcam feature, and the README links to a CodePen demo. The package is installed from npm and its source is public on GitHub. It suits React developers who need a camera preview or a snapshot feature in a web app.…
Highlights
- Live webcam preview in React
- Screenshots with format and quality settings
- Mirrored view and optional audio
- Callbacks for stream success and errors
- Passes extra props to the video element
Ratings & Reviews
No ratings yet
Be the first to rate react-webcam.
People also visit
react-webcam FAQ
What does react-webcam do?
It shows a live webcam feed in a React page and can take screenshots from it.
Why does the camera not start on my site?
The README says browsers throw an error when a page is loaded from an insecure origin, so serve the page over HTTPS.
What screenshot formats are supported?
The screenshotFormat prop defaults to image/webp, and screenshotQuality defaults to 0.92 on a scale from 0 to 1.
How do I install it?
From npm. The README also links to a CodePen demo.
Is it free?
The source is public on GitHub, so the library is open source.
What are the best react-webcam alternatives?
Popular alternatives to react-webcam include react-cropper, react-image-gallery and react-image-crop. See all react-webcam alternatives



















