Abraham

Countdown Timer

Buttons 15

About

Countdown Timer

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

Code

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

Usage.tsx

"use client";

import { Timer } from "@ark-ui/react/timer";
import { Coffee, Pause, Play, RotateCcw } from "lucide-react";

export default function TimerPomodoro() {
  return (
    <div className="bg-white dark:bg-gray-800 w-full px-4 py-12 rounded-xl flex flex-col items-center">
      <Timer.Root
        countdown
        startMs={25 * 60 * 1000}
        className="w-full max-w-sm"
      >
        <div className="bg-red-50 dark:bg-red-950 border-2 border-red-200 dark:border-red-800 rounded-xl p-6">
          <div className="flex items-center justify-center gap-2 mb-4">
            <div className="w-8 h-8 bg-red-500 rounded-full flex items-center justify-center">
              <Coffee className="w-4 h-4 text-white" />
            </div>
            <h3 className="font-semibold text-gray-900 dark:text-gray-100">
              Focus Time
            </h3>
          </div>

          <Timer.Area className="text-center mb-6">
            <div className="inline-flex text-4xl font-bold font-mono text-red-600 dark:text-red-400">
              <Timer.Item type="minutes" className="min-w-[2ch] text-center" />
              <Timer.Separator>:</Timer.Separator>
              <Timer.Item type="seconds" className="min-w-[2ch] text-center" />
            </div>
            <div className="text-sm text-gray-600 dark:text-gray-400 mt-2">
              25 minutes of focused work
            </div>
          </Timer.Area>

          <Timer.Control className="flex justify-center gap-2">
            <Timer.ActionTrigger
              action="start"
              className="flex items-center gap-2 px-4 py-2 bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors text-sm font-medium"
            >
              <Play className="w-4 h-4" />
              Start
            </Timer.ActionTrigger>
            <Timer.ActionTrigger
              action="pause"
              className="p-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
            >
              <Pause className="w-4 h-4" />
            </Timer.ActionTrigger>
            <Timer.ActionTrigger
              action="reset"
              className="p-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
            >
              <RotateCcw className="w-4 h-4" />
            </Timer.ActionTrigger>
          </Timer.Control>
        </div>
      </Timer.Root>
    </div>
  );
}

Dependencies

More by Abraham

View all
  • Signature Pad

    Signature Pad

    107
  • Carousel

    Carousel

    81
  • timeline-animation

    timeline-animation

    65
  • Basic Toast

    Basic Toast

    56
  • Calendar

    Calendar

    54
  • QR Code

    QR Code

    51
  •  Menu

    Menu

    50
  • Steps

    Steps

    43

More in Buttons

View all
  • Button Save

    Button Save

    46
  • Button

    Button

    20
  • Eclipse Button

    Eclipse Button

    5
  • Button

    Button

    32
  • Button

    Button

    6
  • Button

    Button

    14
  • Button Group

    Button Group

    37
  • Split Button

    Split Button

    32