BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/guarahooks/use-eye-dropper-demo

UseEyeDropperDemo

guarahooks/use-eye-dropper-demo
FreeExample

use-eye-dropper's hook in action.

Live preview

live · rendered by the registry
Rendered by guarahooks on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://guarahooks.com/r/use-eye-dropper-demo.json

Source

registry/example/use-eye-dropper-demo.tsxguarahooks.com/r/use-eye-dropper-demo.json
1'use client';
2
3import React from 'react';
4
5import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
6import { Button } from '@/components/ui/button';
7import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
8
9import { useColorPicker } from '@/hooks/guarahooks/use-eye-dropper';
10
11export function ColorPickerExample() {
12 const { color, error, isSupported, pickColor } = useColorPicker();
13
14 return (
15 <Card className="max-w-sm mx-auto shadow-lg border-muted">
16 <CardHeader>
17 <CardTitle className="text-center text-2xl font-bold tracking-tight">
18 Color Picker
19 </CardTitle>
20 </CardHeader>
21 <CardContent>
22 <div className="flex flex-col items-center gap-4">
23 <div className="w-full text-center">
24 <p className="text-sm text-muted-foreground mb-2">
25 Click the button below to pick a color from anywhere on your
26 screen.
27 </p>
28 </div>
29 <div
30 className="rounded-lg mb-2 h-20 w-20 flex items-center justify-center text-white font-semibold border-4 transition-all duration-300"
31 style={{
32 background: color || '#888',
33 borderColor: color ? color : '#888',
34 boxShadow: color ? `0 0 0 4px ${color}33` : undefined,
35 }}
36 >
37 {color ? (
38 <span className="text-xs font-medium drop-shadow">{color}</span>
39 ) : (
40 <span className="text-xs opacity-70">No color selected</span>
41 )}
42 </div>
43
44 {isSupported() ? (
45 <Button
46 onClick={pickColor}
47 className="w-full flex items-center gap-2"
48 variant="default"
49 size="lg"
50 >
51 Pick color
52 </Button>
53 ) : (
54 <Alert variant="destructive" className="w-full">
55 <AlertTitle>Not Supported</AlertTitle>
56 <AlertDescription>
57 EyeDropper API not supported in this browser.
58 </AlertDescription>
59 </Alert>
60 )}
61
62 {error && (
63 <Alert variant="destructive" className="w-full">
64 <AlertTitle>Error</AlertTitle>
65 <AlertDescription>{error.message}</AlertDescription>
66 </Alert>
67 )}
68 </div>
69 </CardContent>
70 </Card>
71 );
72}

What it pulls in

Other registry items

  • card
  • button
  • https://guarahooks.com/r/use-eye-dropper.json

Files it writes

  • registry/example/use-eye-dropper-demo.tsx

Facts

Registry
guarahooks
Type
registry:example
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on guarahooks guarahooks.com h3rmel/guarahooks on GitHub Raw registry item This item as JSON

More from guarahooks

All 100 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
UseAbortControllerDemouse-abort-controller-demoguarahooksExamplesFreeno deps
UseArrayStateDemouse-array-state-demoguarahooksExamplesFreeno deps
UseAxiosDemouse-axios-demoguarahooksExamplesFreeno deps
UseBatteryStatusDemouse-battery-status-demoguarahooksExamplesFreeno deps
UseBetterAuthDemouse-better-auth-demoguarahooksExamplesFreeno deps
UseClickOutsideDemouse-click-outside-demoguarahooksExamplesFreeno deps
UseConfirmDemouse-confirm-demoguarahooksExamplesFreeno deps
UseCookieDemouse-cookie-demoguarahooksExamplesFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex