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

react-svg-path-timer

v1.1.11

Published

Illustrated timer using svg path

Readme

react-svg-path-timer

Timer made with an SVG path. Easily display a timer in a more creative and interactive way! Can also be used for easy SVG animation!

Basic Example

🚀 Getting Started

Using npm:

npm i react-svg-path-timer

✨ Usage

Simplest Use

import React from "react";
import SvgPathTimer from "react-svg-path-timer";

export default function MyComponent() {
  return (
    <div>
      <SvgPathTimer strokeColor={"blue"} />
    </div>
  );
}

Basic Example

Utilizing Props

import React, { useState } from "react";
import SvgPathTimer from "react-svg-path-timer";

export default function MyComponent() {
  const [timerActive, setTimerActive] = useState(false);
  const [resetOnChange, setResetOnChange] = useState(0);

  function finishCallback() {
    document.getElementById("finish-message").innerHTML = "The timer finished!";
  }

  const containerStyles = {
    height: "300px",
    display: "flex",
    flexDirection: "column",
    justifyContent: "center",
    alignItems: "center",
    padding: "50px",
  };

  return (
    <div style={containerStyles}>
      <SvgPathTimer
        time={10}
        active={timerActive}
        resetOnChange={resetOnChange}
        finishCallback={finishCallback}
        d={
          "M32.9,-49.3C33.1,-32.7,17.3,-16.3,20.8,3.5C24.3,23.3,47.1,46.7,46.9,60.5C46.7,74.4,23.3,78.8,5.2,73.6C-13,68.4,-25.9,53.7,-40.7,39.8C-55.5,25.9,-72,13,-65.7,6.3C-59.4,-0.4,-30.3,-0.7,-15.5,-17.4C-0.7,-34,-0.4,-66.9,8,-74.8C16.3,-82.8,32.7,-65.9,32.9,-49.3Z"
        }
        strokeWidth={5}
        strokeLinecap={"round"}
        strokeColor={"#3d405b"}
        pathColor={"#e07a5f"}
        digitalTimerStyles={{ top: "10%" }}
      />
      <button onClick={() => setResetOnChange(resetOnChange + 1)}>Reset</button>
      <div id={"finish-message"}></div>
    </div>
  );
}

Custom Props Example

📌 Props

| Prop | Type | Description | Default | Required | | -------------------- | ------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------- | -------- | | time | Number | Time in seconds for timer to countdown from | 30 | No | | active | Boolean | Timer will only run while active is true | true | No | | resetOnChange | any | Anytime this value is changed the timer will reset. Recommend using a number that increments by 1. | null | No | | finishCallback | func | Callback to be run when timer hits zero | () => {} | No | | d | String | The path to be drawn. Follows standard path commands for an SVG path | "M 0 0 a 50 50 0 1 0 0.001 0 z" (circle) | No | | direction | String | Reverses direction of path movement when set to "backwards" | "forwards" | No | | strokeColor | String | Color of the timer stroke | "white" | No | | pathColor | String | Color of the path the timer stroke follows. Can be set to "none" if unwanted. | "grey" | No | | strokeWidth | Number | The width of the path stroke | 1 | No | | strokeLinecap | String | Can use any standard SVG path linecap | "butt" | No | | fill | String | Color to fill the drawn path with | "none" | No | | digitalTimer | Boolean | Displays a digital timer in the center of the path | true | No | | digitalTimerStyles | Object | Used to add styles to the digital timer. Can be useful to move timer if your path crosses over it. | {} | No | | infinite | Boolean | If true, infinitely loops, resetting the timer and rerunning upon finish. Overrides infiniteReverse. | false | No | | infiniteReverse | Boolean | Same as infinite but reverses direction each loop. Overridden by infinite. | false | No | | countUp | Boolean | If true, counts up instead of down | false | No | | height | String | Specifies height in any standard unit | "100%" | No | | width | String | Specifies width in any standard unit | "100%" | No |