Components
An animated countdown timer where a snail slowly crawls across the screen leaving a dust trail while the remaining seconds tick down.
Loading preview...
"use client";
import * as React from "react";
import { SnailTimer } from "@/components/ui/snail-timer";
export default function SnailTimerDemo() {
const [started, setStarted] = React.useState(false);
return (
<div className="relative flex h-[420px] w-full items-center justify-center overflow-hidden rounded-xl border bg-background text-foreground">
<button
type="button"
onClick={() => setStarted((prev) => !prev)}
className="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90"
>
{started ? "Stop Timer" : "Start Countdown"}
</button>
<SnailTimer started={started} />
</div>
);
}