npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

on-react-countdown

v1.1.5

Published

Simple countdown

Downloads

1,402

Readme

Simple react countdown

Simple countdown for React.

Usage

Install

You can use npm or yarn:

npm install on-react-countdown
yarn add on-react-countdown

Basic usage

import React from 'react';
import Countdown from 'on-react-countdown';
 
ReactDOM.render(
  <Countdown end={1893456000} />,
  document.getElementById('root')
);

Props

Name | Type | Default :-------- |:-----:| :-----: | end | number | required endInSeconds | bool | false utc | number | 0 lang | string | en className | string | Countdown text | object | look prop text separator | string | ' ' wordsEndingOff | bool | false wordsOff | bool | false hideZeroValues | bool | false alwaysDoubleDigit | bool | false limit | number | null onEnd | func | () => {}

end

End of timer on UNIX format

endInSeconds

If true, in end the number of seconds should be passed before the timer ends

utc

Utc zone, for New York - utc={-4}, for Moscow utc={3}

lang

Language for time periods. Two types are available: English and Russian. English is selected by default. For English (French, German, etc.) there is no declension, so there are only two types of time periods - singular and plural - ['day', 'days'].

For Russian (Ukrainian, Belorussian, etc.), declinations exists, therefore there are three types of time periods - for one, for two to four, for five and more - ['день', 'дня', 'дней'].

More information is available in text.

className

Class for HTML elements

text

An Object with the names of time periods. By default (English, etc):

{
    days: ['day', 'days'],
    hours: ['hour', 'hours'],
    minutes: ['minute', 'minutes'],
    seconds: ['second', 'seconds'],
}

For Russian, etc:

{
    days: ['день', 'дня', 'дней'],
    hours: ['час', 'часа', 'часов'],
    minutes: ['минута', 'минуты', 'минут'],
    seconds: ['секунда', 'секунды', 'секунд'],
}

if you use wordsEndingOff={true}, for English, etc.

{
    days: 'd',
    hours: 'h',
    minutes: 'm',
    seconds: 's',
}

For Russian, etc:

{
    days: 'дн.',
    hours: 'ч.',
    minutes: 'мин.',
    seconds: 'сек.',
}

separator

Separator for time periods

wordsEndingOff

wordsEndingOff={true} uses if you pass the text similar to

{
    days: 'd',
    hours: 'h',
    minutes: 'm',
    seconds: 's',
}

wordsOff

Only the values ​​of time periods are displayed, without text

hideZeroValues

Hide time periods with a value of 0

alwaysDoubleDigit

Always display the time period value with a two-digit number, 09 days 02 hours 17 minutes 01 second instead of 9 days 2 hours 17 minutes 1 second

limit

It displays as many time periods as specified in limit, starting with a larger one. If the value of the time period is 0, the period is not taken into account

onEnd

Callback function which is called at the end of the timer

The translation was undertaken by: Antonova Anastasia