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

UseIdleDemo

guarahooks/use-idle-demo
FreeExample

use-idle's hook in action.

Install it

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

Source

registry/example/use-idle-demo.tsxguarahooks.com/r/use-idle-demo.json
1'use client';
2
3import React from 'react';
4
5import { Badge } from '@/components/ui/badge';
6import { Button } from '@/components/ui/button';
7import {
8 Card,
9 CardContent,
10 CardDescription,
11 CardHeader,
12 CardTitle,
13} from '@/components/ui/card';
14
15import { cn } from '@/lib/utils';
16
17import { useIdle } from '@/hooks/guarahooks/use-idle';
18
19export default function UseIdleDemo() {
20 // 2 seconds of timeout
21 const [idle, resetIdle] = useIdle(2000);
22
23 return (
24 <Card className="relative max-w-sm w-full">
25 <CardHeader>
26 <CardTitle>useIdle</CardTitle>
27 <CardDescription>
28 This component uses the <code>useIdle</code> hook to detect if the
29 user is idle for a given timeout (2 seconds).
30 </CardDescription>
31 </CardHeader>
32 <CardContent className="space-y-4">
33 <Badge
34 variant="secondary"
35 className={cn(
36 'w-fit',
37 idle
38 ? 'bg-red-500/30 border-red-500'
39 : 'bg-green-500/30 border-green-500',
40 )}
41 >
42 The user is{' '}
43 <p
44 className={cn(
45 'text-foreground font-bold uppercase',
46 idle ? 'text-red-500' : 'text-green-500',
47 )}
48 >
49 {idle ? 'idle' : 'active'}
50 </p>
51 </Badge>
52 <p className="text-sm text-muted-foreground">
53 Interact with the page (keyboard, mouse, scroll, etc) to reset the
54 idle timer.
55 </p>
56 <Button size="sm" onClick={resetIdle}>
57 Or click here
58 </Button>
59 </CardContent>
60 </Card>
61 );
62}

What it pulls in

Other registry items

  • card
  • badge
  • button
  • https://guarahooks.com/r/use-idle.json

Files it writes

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

Facts

Registry
guarahooks
Type
registry:example
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-09
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