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-notifications-demo

UseNotificationsDemo

guarahooks/use-notifications-demo
FreeExample

use-notifications's hook in action.

Install it

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

Source

registry/example/use-notifications-demo.tsxguarahooks.com/r/use-notifications-demo.json
1'use client';
2
3import {
4 AlertCircleIcon,
5 BellIcon,
6 CheckCircle2Icon,
7 XCircleIcon,
8} from 'lucide-react';
9
10import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
11import { Badge } from '@/components/ui/badge';
12import { Button } from '@/components/ui/button';
13import {
14 Card,
15 CardContent,
16 CardDescription,
17 CardFooter,
18 CardHeader,
19 CardTitle,
20} from '@/components/ui/card';
21
22import { useNotifications } from '@/hooks/guarahooks/use-notifications';
23
24export default function UseNotificationsDemo() {
25 const {
26 permission,
27 requestPermission,
28 showNotification,
29 isSupported,
30 isSecureContext,
31 supportsActions,
32 supportsBadge,
33 supportsImage,
34 supportsVibrate,
35 supportsSound,
36 } = useNotifications();
37
38 const handleRequestPermission = async () => {
39 try {
40 await requestPermission();
41 } catch (error) {
42 console.error('Failed to request permission:', error);
43 }
44 };
45
46 const handleShowNotification = () => {
47 showNotification('Demo Notification', {
48 body: 'This is a test notification from the demo component',
49 icon: '/favicon.ico',
50 badge: '/favicon.ico',
51 image: '/favicon.ico',
52 // Actions are only supported with Service Worker
53 // actions: [
54 // {
55 // action: 'view',
56 // title: 'View Details',
57 // },
58 // ],
59 });
60 };
61
62 return (
63 <Card className="relative max-w-2xl w-full">
64 <CardHeader>
65 <CardTitle className="flex items-center gap-2">
66 <BellIcon className="h-5 w-5" />
67 useNotifications
68 </CardTitle>
69 <CardDescription>
70 This component demonstrates the use of the{' '}
71 <code>useNotifications</code> hook to manage browser notifications.
72 </CardDescription>
73 </CardHeader>
74 <CardContent className="space-y-4">
75 <div className="space-y-2">
76 <h3 className="font-medium">Browser Support</h3>
77 <div className="flex flex-wrap gap-2">
78 <Badge variant={isSupported ? 'default' : 'destructive'}>
79 {isSupported ? 'Supported' : 'Not Supported'}
80 </Badge>
81 <Badge variant={isSecureContext ? 'default' : 'destructive'}>
82 {isSecureContext ? 'Secure Context' : 'Not Secure'}
83 </Badge>
84 </div>
85 </div>
86
87 <div className="space-y-2">
88 <h3 className="font-medium">Feature Support</h3>
89 <div className="flex flex-wrap gap-2">
90// … truncated

What it pulls in

Other registry items

  • card
  • alert
  • button
  • badge
  • lucide-react
  • https://guarahooks.com/r/use-notifications.json

Files it writes

  • registry/example/use-notifications-demo.tsx

Facts

Registry
guarahooks
Type
registry:example
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-11
Last confirmed
today

Go to the source

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

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex