GooseUI

Components

Animated Timer


A clock with sliding digits and a gradient border. The markup and the animation are server HTML and CSS. A tiny client script reads the time in the visitor's time zone once a second and writes the digits into data attributes, so React never re-renders on a tick. Before the script runs, the clock shows dimmed zeros.

Browser Support

Individual transform properties

Slides the digits into place.

Your browser:

Preview

Installation

npx shadcn@latest add @gooseui/animated-timer
pnpm dlx shadcn@latest add @gooseui/animated-timer
yarn dlx shadcn@latest add @gooseui/animated-timer
bunx --bun shadcn@latest add @gooseui/animated-timer

Usage

import { AnimatedTimer } from "@/components/ui/animated-timer"

export default function Page() {
  return <AnimatedTimer />
}

Examples

Without seconds

<AnimatedTimer showSeconds={false} />

12-hour format

<AnimatedTimer use24Hour={false} />

Props

PropTypeDefaultDescription
showSecondsbooleantrueShow seconds
use24Hourbooleantrue24-hour format
classNamestring-Additional classes