BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/spectrumui/quota-banner

Quota Banner

spectrumui/quota-banner
FreeBlock

A message-quota banner with a live reset countdown.

Install it

npx shadcn@latest add https://ui.spectrumhq.in/r/quota-banner.json

Source

components/spectrumui/blocks/ai-assistants/quota-banner.tsxui.spectrumhq.in/r/quota-banner.json
1'use client';
2
3import { useEffect, useState } from 'react';
4import { Zap } from 'lucide-react';
5import { cn } from '@/lib/utils';
6
7export type QuotaBannerVariant = 'Banner' | 'Compact';
8
9export interface QuotaBannerProps {
10 used: number;
11 limit: number;
12 resetsInSeconds?: number;
13 upgradeLabel?: string;
14 onUpgrade?: () => void;
15 variant?: QuotaBannerVariant;
16 className?: string;
17}
18
19function useCountdown(seconds?: number) {
20 const [remaining, setRemaining] = useState(seconds ?? 0);
21 useEffect(() => {
22 setRemaining(seconds ?? 0);
23 if (!seconds) return;
24 const t = setInterval(() => setRemaining((value) => Math.max(0, value - 1)), 1000);
25 return () => clearInterval(t);
26 }, [seconds]);
27 const minutes = Math.floor(remaining / 60);
28 return `${minutes}:${String(remaining % 60).padStart(2, '0')}`;
29}
30
31export function QuotaBanner({
32 used,
33 limit,
34 resetsInSeconds,
35 upgradeLabel = 'Upgrade',
36 onUpgrade,
37 variant = 'Banner',
38 className,
39}: QuotaBannerProps) {
40 const countdown = useCountdown(resetsInSeconds);
41 const ratio = Math.min(1, used / limit);
42 const exhausted = used >= limit;
43
44 if (variant === 'Compact') {
45 return (
46 <div
47 className={cn(
48 'flex w-fit items-center gap-2.5 rounded-full border border-black/[0.08] bg-white py-1.5 pl-3 pr-1.5 text-[12px] dark:border-white/[0.09] dark:bg-[#0B0B0D]',
49 className,
50 )}
51 >
52 <span className="font-mono tabular-nums text-neutral-600 dark:text-neutral-300">
53 {used}/{limit}
54 </span>
55 <span aria-hidden className="h-1 w-12 overflow-hidden rounded-full bg-black/[0.07] dark:bg-white/[0.09]">
56 <span
57 className={cn(
58 'block h-full rounded-full transition-[width] duration-500 ease-[cubic-bezier(0.23,1,0.32,1)]',
59 exhausted ? 'bg-amber-500' : 'bg-neutral-900 dark:bg-neutral-100',
60 )}
61 style={{ width: `${ratio * 100}%` }}
62 />
63 </span>
64 {resetsInSeconds !== undefined && (
65 <span className="font-mono text-[10.5px] tabular-nums text-neutral-400 dark:text-neutral-600">
66 {countdown}
67 </span>
68 )}
69 </div>
70 );
71 }
72
73 return (
74 <div
75 role="status"
76 className={cn(
77 'flex w-full max-w-[480px] items-center gap-3 rounded-xl border py-2.5 pl-3 pr-2',
78 exhausted
79 ? 'border-amber-500/25 bg-amber-500/[0.06]'
80// … truncated

What it pulls in

npm packages

  • lucide-react

Files it writes

  • components/spectrumui/blocks/ai-assistants/quota-banner.tsx

Facts

Registry
spectrumui
Type
registry:block
Access
Free
Files written
1
Licence
Apache-2.0
In the index
at or before 2026-08-11
Last confirmed
today

Go to the source

ui.spectrumhq.in arihantcodes/spectrum-ui on GitHub Raw registry item This item as JSON

More from spectrumui

All 182 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Agent Planagent-planspectrumuiBlocksFree1 dep
Agent Stepsagent-stepsspectrumuiBlocksFree1 dep · 2 files
Approval Cardapproval-cardspectrumuiBlocksFree1 dep
Chat Empty Statechat-empty-statespectrumuiBlocksFree1 dep · 2 files
Citation Sourcescitation-sourcesspectrumuiBlocksFreeno deps · 2 files
Code Blockcode-blockspectrumuiBlocksFree1 dep
Conversation Listconversation-listspectrumuiBlocksFree1 dep
Diff Viewdiff-viewspectrumuiBlocksFree1 dep

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