FlipClock

Documentation

Integrate FlipClock into your React application in minutes.

Installation

Install the package using npm, yarn, or pnpm.

npm install @hasthiya_/flip-clock

Basic Usage

Import the component and pass a target date.

import FlipClock from "@hasthiya_/flip-clock";

<FlipClock targetDate={new Date("2026-12-31T00:00:00")} />

Note: In Next.js, use FlipClock inside a Client Component ("use client").

Props Reference

PropTypeDefaultDescription
targetDateDate88 days from nowThe target date to count down to.
staticTime{ days?, hours?, minutes?, seconds? }Override the countdown with static values (disables auto-tick).
cardStyleFlipCardStyleCard appearance: background, backgroundDark, width, height, borderRadius, boxShadow.
digitStyleFlipDigitStyleDigit typography: color, fontFamily, fontSize, textShadow.
labelStyleFlipLabelStyleLabel configuration: visible, color, fontFamily, fontSize, fontWeight, letterSpacing, textTransform.
lineStyleFlipLineStyleHorizontal divider line on each card: color, height.
animationFlipAnimationConfigFlip animation: flipDuration, bounceIntensity, flipDownEasing, flipUpEasing.
separatorFlipSeparatorConfignoneSeparator between groups: type ('none' | 'colon' | 'dot'), color, size.
labelsFlipClockLabelsCustom label text for days, hours, minutes, seconds.
segmentsFlipClockSegmentsall trueWhich segments to display: days, hours, minutes, seconds.
dayDigitsnumber2Number of digits for the days display.
groupGapstring'3rem'Gap between time groups (CSS value).
cardGapstring'0.375rem'Gap between individual digit cards (CSS value).
labelGapstring'1rem'Gap between cards and the label (CSS value).
onComplete() => voidCallback fired when countdown reaches zero.
orientation'row' | 'column''row'Layout direction: row (horizontal) or column (stacked).
scalenumber1Scale factor for the whole clock. Example: scale={0.8} for 80% size.
classNamestringAdditional className for the outer wrapper.
styleCSSPropertiesAdditional inline style for the outer wrapper.