New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-countdown-minify

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-countdown-minify

A simple React countdown component.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
8
-65.22%
Maintainers
1
Weekly downloads
 
Created
Source

Countdown Timer

npm version npm downloads License

Overview

A customizable React countdown timer component that supports multiple time formats, allows users to define a callback when the countdown ends, and supports custom styling.

Installation

You can install the package using npm:

npm install react-countdown-timer-minify

Or install it locally from a .tgz file:

npm install ../react-countdown-timer-minify.tgz

Usage

Import and use the CountdownTimer component in your project:

import React from "react";
import CountdownTimer from "react-countdown-timer-minify";

const App = () => {
  return (
    <div>
      {/* Default Countdown Timer (Minutes input) */}
      <CountdownTimer duration={1920} />

      {/* Countdown Timer with Different Formats */}
      <CountdownTimer duration={1920} format="hh:mm:ss" />
      <CountdownTimer duration={1920} format="dd:hh:mm:ss" />
      <CountdownTimer duration={1920} format="ddd hh:mm" />
      <CountdownTimer duration={1920} format="ddd hh:mm:ss" />

      {/* Countdown Timer with Custom Styling */}
      <CountdownTimer
        duration={330}
        style={{ color: "red", fontSize: "24px", backgroundColor: "yellow" }}
      />

      {/* Countdown Timer with Callback on End */}
      <CountdownTimer duration={60} onEnd={() => alert("Time's up!")} />
    </div>
  );
};

export default App;

Customization:

  • Duration: Set the initial countdown time in minutes (default is 0).
  • Format: Choose a format for displaying the countdown (default is hh:mm:ss). Available options:
    • hh:mm:ss
    • hhh:mm:ss
    • dd:hh:mm:ss
    • mm:ss
    • mmm:ss
    • ddd hh:mm
    • ddd hh:mm:ss
  • On End Callback: Pass a function to execute when countdown reaches zero (default is an empty function () => {}).
  • Custom Styles: Pass custom CSS properties to style the countdown display.

Default Styling

The component comes with default styling:

.countdown-timer {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  background-color: #f4f4f4;
  padding: 10px;
  border-radius: 5px;
  display: inline-block;
}

License

This project is licensed under the MIT License.

Keywords

react

FAQs

Package last updated on 29 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts