react-headless-countdown
v1.3.0
Published
Simple react date countdown without UI
Downloads
11
Readme
react-headless-countdown
React date countdown using render props. Support for hooks is on its way :)
Install
npm install --save react-headless-countdown
Usage
import React, { Component } from "react";
import DateCountdown from "react-headless-countdown";
class Example extends Component {
render() {
const date = new Date("2021-01-01"); // New year 2021!
return (
<DateCountdown date={date}>
{({ timeLeft, isValidDate, isValidFutureDate }) => (
<div>Render the countdown here!</div>
)}
</DateCountdown>
);
}
}
Example in action here. You can checkout the examples folder for how to use it.
License
MIT © Param-Harrison