UNPKG

react-count-until

Version:

count down to time

48 lines (36 loc) 1.76 kB
# React Count Until Count down until the given time ## Installation Install react-countdown-until with npm ```bash npm install react-countdown-until ``` ## Usage/Examples ```javascript import CountDown from "react-countdown-until"; function App() { return ( <> {/* returns in format yyy:MM:dd:HH:mm:ss */} <CountUntil /> {/* or */} <CountUntil date={new Date("2025-01-01")} /> </> ); } ``` ## API Reference | Parameter | Type | Description | Default | | :--------------- | :-------- | :------------------------------------------ | :----------------- | | `date` | `Date` | **Optional**. A future Date object | `null` | | `className` | `string` | **Optional**. Class names for root div | `'flex font-mono'` | | `requireLabels` | `boolean` | **Optional**. Display locales as labels | `false` | | `seperator` | `string` | **Optional**. Seperator between timer parts | `':'` | | `displayYears` | `boolean` | **Optional**. To display years part | `true` | | `displayMonths` | `boolean` | **Optional**. To display months part | `true` | | `displaydays` | `boolean` | **Optional**. To display days part | `true` | | `displayHours` | `boolean` | **Optional**. To display hours part | `true` | | `displayMinutes` | `boolean` | **Optional**. To display minutes part | `true` | | `displaySeconds` | `boolean` | **Optional**. To display seconds part | `true` | ## Authors - [@lizardkingLK](https://github.com/lizardkingLK)