Flip clock
8starlabs-ui/flip-clock-showdays-demoFreeExample
A flip clock demo component
Install it
npx shadcn@latest add https://ui.8starlabs.com/r/flip-clock-showdays-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 FlipClockShowDaysDemo() {9 const [targets, setTargets] = useState<{10 oneDay: Date;11 fiveHundredDays: Date;12 }>();1314 useEffect(() => {15 const now = Date.now();1617 setTargets({18 oneDay: new Date(now + DAY),19 fiveHundredDays: new Date(now + DAY * 500)20 });21 }, []);2223 return (24 <div className="flex flex-col gap-8">25 {/* Always show days, even if zero */}26 <FlipClock27 countdown={true}28 showDays="always"29 targetDate={targets?.oneDay}30 size={"md"}31 />32 {/* Show days only if non-zero */}33 <FlipClock34 countdown={true}35 showDays="auto"36 targetDate={targets?.oneDay}37 size={"md"}38 />39 {/* Never show days, even if 1 or more */}40 <FlipClock41 countdown={true}42 showDays="never"43 targetDate={targets?.fiveHundredDays}44 size={"md"}45 />46 </div>47 );48}
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-countdown-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-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 |
