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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-date-digital-clock

v1.1.2

Published

A fully customizable React component that displays both current date and a digital clock, built with Tailwind CSS utility classes. Easily adaptable to your design system by adding or removing Tailwind classes via props.

Readme

📆 react-date-digital-clock

A lightweight and fully customizable React component to display the current date, day name, and digital clock. Built with Tailwind CSS in mind, but also works with inline styles. You can style it freely using utility classes or custom CSS.

✨ Features

  • ⏰ Displays live digital clock (updates every second)
  • 📅 Automatically updates date at midnight
  • 🗓️ Shows day name (e.g., SAT, SUN) in bold, customizable style
  • 🎨 Fully customizable via props for Tailwind or custom class names
  • 🧩 Supports dynamic width/height via style props
  • ⚛️ No external dependencies

📦 Installation

npm install react-date-digital-clock

Create a taiwind.config.js if not present and add the given code

safelist: [
           'p-2', 'text-center', 'border', 'rounded-lg', 'm-1',
           'px-2', 'py-2', 'text-xl', 'font-semibold',
           'font-bold', 'text-4xl', 'bg-black', 'text-white'
   ],

as shown below:

tailwind.config.js

export default {
    safelist: [
            'p-2', 'text-center', 'border', 'rounded-lg', 'm-1',
            'px-2', 'py-2', 'text-xl', 'font-semibold',
            'font-bold', 'text-4xl', 'bg-black', 'text-white'
    ],
    theme: {
        extend: {},
    },
    plugins: [],
}

to use the component you can import it as follow

Usage

import DateAndClock from "../react-date-digital-clock";

<DateAndClock ></DateAndClock>

Live-Preview

Live Preview

📚 Props Table

| Prop | Type | Default Value | Description | |----------------|----------|----------------------------------------------------|-------------| | w | string | '130px' | Minimum width of the container. Applied via inline style minWidth. | | h | string | '' | Height of the container. Applied via inline style={{ height: h }} | isDayNameRequired|boolean|true|Toggles the display of the day name (SAT, SUN, etc.). | generalProps | string | 'p-2 flex justify-center items-center text-center border rounded-lg m-1 w-auto' | Tailwind (or custom) classes for the outer <div> container | | dateProps | string | 'px-2' | Tailwind or custom classes applied to the date element | | clockProps | string | 'px-2' | Tailwind or custom classes applied to the clock element | dayNameProps |string |'flex items-center justify-center bg-black text-white rounded-md p-2 font-bold text-4xl'| Tailwind or custom classes applied to the day name element. Only used if isDayNameRequired = true.

note: The default classes of the above table are of tailwind css

🧱 Component Structure

<div className={generalProps} style={{ minWidth: w, height: h, width: "fit-content" }}>
  <div>
    <h1 className={dateProps}>{date}</h1>
    <h1 className={clockProps}>{time}</h1>
  </div>
  <div className={dayNameProps}>
    <h1>{dayName}</h1>
  </div>
</div>
  • ✅ generalProps: Styling for the wrapper
  • 📅 dateProps: Styling for the date (dd/mm/yyyy)
  • ⏰ clockProps: Styling for the live-updating time (HH:MM:SS)
  • dayNameProps: Styling for the day name (e.g., SAT)
  • 📐 w & h: Apply dynamic width/height using inline styles

📬 Contributing / Support

  • Have ideas or issues?
  • Please open an issue or submit a pull request.