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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sinaasghari/react-analog-clock

v1.0.9

Published

A customizable analog clock component for React with timezone support and responsive scaling.

Readme

🕰️ React Analog Clock

React Analog Clock Screenshot

A lightweight, customizable analog clock component for React — supports dynamic resizing, color themes, timezone offset, and optional hour numbers.

📦 NPM
🌐 Live Preview


🚀 Installation

npm install @sinaasghari/react-analog-clock

or with Yarn:

yarn add @sinaasghari/react-analog-clock

📦 Usage

import AnalogClock from "@sinaasghari/react-analog-clock";

export default function App() {
  return (
    <AnalogClock
      size={300}
      showNumbers={true}
      centerDotColor="#000"
      hourColor="#333"
      minutesColor="#555"
      secondColor="red"
      timezoneOffset={60} // Timezone offset in minutes (e.g. GMT+1 = 60)
    />
  );
}

⚙️ Props

| Prop | Type | Default | Description | |-------------------|---------------------|-----------|-----------------------------------------------------------------------------| | size | number | 300 | Overall size of the clock (scales everything proportionally) | | showNumbers | boolean | true | Whether to show the hour numbers (1–12) | | centerDotColor | string (CSS color)| "#ccc" | Color of the central pivot dot | | hourColor | string (CSS color)| "#333" | Color of the hour hand | | minutesColor | string (CSS color)| "#666" | Color of the minute hand | | secondColor | string (CSS color)| "red" | Color of the second hand | | style | React.CSSProperties | {} | Custom inline styles applied to the clock container | | timezoneOffset | number (minutes) | 0 | Timezone offset in minutes (e.g. Iran = +210, New York = -240) |


🖌️ Styling

The component uses a style.css file internally. You can override styles using the style prop or by overriding class names:

  • .clock
  • .dot
  • .hour, .twelve, .one, ..., .eleven
  • .hour-hand
  • .minute-hand
  • .second-hand

🕓 Timezone Support

The timezoneOffset prop allows you to set the clock to a specific timezone.

Example:
For Iran (UTC+3:30), pass timezoneOffset={210}.


📌 Notes

  • The clock updates every second using setInterval.
  • Fully responsive: the size scales proportionally using CSS transform: scale(...).

📃 License

MIT © Sina Asghari


📬 Contact

Feel free to reach out: