--- title: useEyeDropper description: "`useEyeDropper` is a custom hook that opens the eye dropper tool and returns the color value." links: - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/hooks/use-eye-dropper --- # useEyeDropper `useEyeDropper` is a custom hook that opens the eye dropper tool and returns the color value. ```tsx const { supported, onOpen } = useEyeDropper() const [color, setColor] = useState("#FF0000") const onClick = async () => { const result = await onOpen() if (result) setColor(result.sRGBHex) } return ( {color} EyeDropper API is not supported in this browser. ) ``` ## Usage ```tsx import { useEyeDropper } from "@yamada-ui/react" ``` ```tsx import { useEyeDropper } from "@/components/ui" ``` ```tsx import { useEyeDropper } from "@workspaces/ui" ``` ```tsx const { supported, onOpen } = useEyeDropper() ``` ## Used By Components & Hooks - [ColorPicker](https://yamada-ui.com/docs/components/color-picker.md): `ColorPicker` is a component used by the user to select a color or enter an arbitrary color value. - [ColorSelector](https://yamada-ui.com/docs/components/color-selector.md): `ColorSelector` is a component used by the user to select a color.