@layerhub-io/react-eye-dropper
v0.0.3
Published
React Eye Dropper component and hook
Downloads
142
Readme
React Eye Dropper
React Eye Dropper component for all browsers
Installation
pnpm install @layerhub-io/react-eye-dropper
Usage
Use as hook
import { useEyeDropper } from "@layerhub-io/react-eye-dropper";
function App() {
const { onInit, color } = useEyeDropper();
return (
<div style={{ backgrounColor: color }}>
<div onClick={onInit}>TRIGGER</div>
</div>
);
}
Use as component
import EyeDropper from "@layerhub-io/react-eye-dropper";
function App() {
const onChange = (c) => {
console.log({ c });
};
return (
<div style={{ backgrounColor: color }}>
<EyeDropper onChange={onChange}>
<div>TRIGGER</div>
</EyeDropper>
</div>
);
}