my-react-camera
v0.1.2
Published
camera component with switching devices using react and coverting the image into base64 string
Readme
My React Camera
A React component for capturing photos using device cameras.
Installation
# Install the package
npm install my-react-camera
# Install peer dependencies
npm install @mui/material @mui/icons-material @emotion/react @emotion/styledUsage
import { Camera } from "my-react-camera";
function App() {
const handleCapture = (base64Image) => {
console.log("Captured image:", base64Image);
};
return (
<div>
<Camera onCapture={handleCapture} />
</div>
);
}Props
| Prop | Type | Description | | --------- | ------------------------------ | --------------------------------------------------------------------- | | onCapture | (base64String: string) => void | Callback function that receives the captured image as a base64 string |
Requirements
This package requires the following peer dependencies:
- React 18 or higher
- Material-UI v5 or higher
- Emotion 11 or higher
