Cameron Kelliher

Upstash Counter

Component 12

About

Animated number counter with smooth transitions, compact formatting, and optional increment/decrement controls for displaying Redis counters.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Upstash Counter to your project and fits it to your theme.

Code

How Upstash Counter is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { UpstashCounter } from "@/components/ui/upstash-counter";
import { useState } from "react";

export default function UpstashCounterDemo() {
  const [views, setViews] = useState(1234);

  return (
    <div className="flex min-h-[320px] w-full items-center justify-center bg-background p-8">
      <div className="flex flex-col items-center gap-10">
        <UpstashCounter
          value={views}
          label="Page Views"
          format="compact"
          size="lg"
          showControls
          onIncrement={() => setViews((c) => c + 1)}
          onDecrement={() => setViews((c) => Math.max(0, c - 1))}
        />

        <div className="flex items-center gap-12 border-t border-border pt-8">
          <UpstashCounter
            value={15800}
            label="Users"
            format="compact"
            size="sm"
          />
          <UpstashCounter
            value={2500000}
            label="Requests"
            format="compact"
            size="sm"
          />
        </div>
      </div>
    </div>
  );
}

More by Cameron Kelliher

View all
  • AI Chain of Thought

    AI Chain of Thought

    111
  • Helix Loader

    Helix Loader

    94
  • AI Streaming Text

    AI Streaming Text

    50
  • AI Tool Call

    AI Tool Call

    45
  • Signal Bars Loader

    Signal Bars Loader

    41
  • Glitch Text Loader

    Glitch Text Loader

    41
  • AI Prompt Diff

    AI Prompt Diff

    39
  • AI Routing Indicator

    AI Routing Indicator

    34