@layerhub-io/react-eye-dropper
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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>
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i @layerhub-io/react-eye-dropper

Weekly Downloads

9

Version

0.0.3

License

ISC

Unpacked Size

923 kB

Total Files

9

Last publish

Collaborators

  • chloe-bm
  • xorb