Flip clock
8starlabs-ui/flip-clock-countdown-demoFreeExample
A flip clock demo component
Install it
npx shadcn@latest add https://ui.8starlabs.com/r/flip-clock-countdown-demo.jsonSource
1"use client";23import { useEffect, useState } from "react";4import FlipClock from "@/registry/8starlabs-ui/blocks/flip-clock";56const DAY = 1000 * 60 * 60 * 24;78export default function FlipClockCountdownDemo() {9 const [targets, setTargets] = useState<{10 oneDay: Date;11 tenDays: Date;12 fiveHundredDays: Date;13 }>();1415 useEffect(() => {16 const now = Date.now();1718 setTargets({19 oneDay: new Date(now + DAY),20 tenDays: new Date(now + DAY * 10),21 fiveHundredDays: new Date(now + DAY * 500)22 });23 }, []);2425 return (26 <div className="flex flex-col gap-8">27 {/* 1 day ahead */}28 <FlipClock countdown={true} targetDate={targets?.oneDay} size={"md"} />2930 {/* 10 days ahead */}31 <FlipClock32 variant="secondary"33 countdown={true}34 targetDate={targets?.tenDays}35 size={"md"}36 />3738 {/* 500 days ahead */}39 <FlipClock40 variant="muted"41 countdown={true}42 targetDate={targets?.fiveHundredDays}43 size={"md"}44 />45 </div>46 );47}
Files it writes
More from 8starlabs-ui
All 74 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Buttonbutton-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-showdays-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-size-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-variants-demo | 8starlabs-ui | Examples | Free | no deps | |
| Heatmapheatmap-custom-colors-demo | 8starlabs-ui | Examples | Free | no deps | |
| Heatmapheatmap-custom-display-demo | 8starlabs-ui | Examples | Free | no deps | |
| Heatmapheatmap-days-of-week-demo | 8starlabs-ui | Examples | Free | no deps |
