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

@stephanluis/react-countdown-circle-timer-editable

v0.2.3

Published

Editable React circle countdown using react-input-duration and react-countdown-circle-timer.

Readme

React-Countdown-Circle-Timer-Editable

An independent integration of @stephanluis/react-input-duration and react-countdown-circle-timer. The duration input sits inside an animated countdown circle. While running, the circle shows the remaining time; after completion it shows “Too late ...”. Applications provide their own buttons.

Try the live demo

Editable React circle countdown demo

Installation

npm install @stephanluis/react-countdown-circle-timer-editable

React 18.2 or 19 and React DOM are required.

Usage

import { useRef, useState } from 'react';
import EditableCircleCountdown from '@stephanluis/react-countdown-circle-timer-editable';

function TimerExample() {
    const timer = useRef(null);
    const [running, setRunning] = useState(false);
    const [completed, setCompleted] = useState(false);
    const [status, setStatus] = useState('Ready.');

    function start() {
        try {
            timer.current.start();
        } catch (error) {
            setStatus(error.message);
        }
    }

    return <>
        <EditableCircleCountdown ref={timer} initialValue="0:00:00:10.000"
            onStart={() => { setCompleted(false); setRunning(true); setStatus('Countdown running.'); }}
            onStop={() => { setRunning(false); setStatus('Countdown stopped.'); }}
            onComplete={() => { setRunning(false); setCompleted(true); setStatus('Countdown complete.'); }} />
        <button type="button" onClick={running ? () => timer.current.stop() : completed
            ? () => { timer.current.edit(); setCompleted(false); setStatus('Ready.'); } : start}>
            {running ? 'Stop' : completed ? 'Edit' : 'Start'}
        </button>
        <p role="status">{status}</p>
    </>;
}

initialValue accepts HH:mm:ss.SSS or D:HH:mm:ss.SSS and is used only on mount. start() uses the last committed duration and throws if the input is not ready, invalid, zero, or outside JavaScript's safe integer and date ranges. stop() preserves the remaining duration for editing. Each method returns true when it acts and false if already in that state. onStart, onStop, and onComplete are React callbacks; stopping after the deadline calls onComplete instead of onStop. The input is disabled while running. After completion, call edit() to show the editor again; it returns true when the completion display is dismissed and false otherwise. Remaining time is displayed as total minutes and seconds, rounded up to the next second. Use idleColor to set the circle color when it is not running (default #004777). Set showDays={false}, noHours, and noMicroseconds to display only minutes and seconds. When noMicroseconds is enabled, stopping rounds the remaining time up to a whole second so the editable value matches the countdown display. Hidden fields otherwise retain their values. minutesDivider and secondsDivider customize the input's separators. Like input-duration, the seconds divider is normally hidden when milliseconds are hidden; the demo uses CSS to show it as an s suffix.

Customizing the input and circle

Pass options for the underlying components through inputProps and circleProps:

<EditableCircleCountdown
    initialValue="00:00:10.000"
    inputProps={{ name: 'duration', tabThrough: true, onChange: value => console.log(value) }}
    circleProps={{
        size: 220,
        colors: '#004777',
        children: ({ remainingTime, color }) => (
            <span style={{ color }}>{remainingTime > 0 ? `${remainingTime}s` : 'Done'}</span>
        ),
    }}
/>

inputProps accepts the React input-duration props, including visibility, separators, HTML attributes, and onChange. The integration manages value and defaultValue; use initialValue to set the initial duration. Its own existing top-level input options take precedence over the corresponding inputProps. The input is always disabled while running; inputProps.disabled can also disable it while idle.

circleProps accepts the countdown timer's appearance options and onUpdate. Its children render function receives the original timer's remainingTime, elapsedTime, and color while running or completed; the editor remains visible when idle. Without it, the default running and completion displays are used. The integration manages duration, initialRemainingTime, isPlaying, and onComplete, so those cannot be overridden through circleProps. Use the integration's onComplete callback instead; automatic repeats are not supported. Custom colors apply while running and completed; idleColor controls the idle circle. For an array of colors, supply colorsTime as required by the original timer.

This project is not affiliated with or endorsed by react-countdown-circle-timer.

Local demo

Run npm install, then npm run demo, and open the URL printed by Vite. Run npm test to check the integration and its TypeScript declarations. The demo initially shows the default time paused and lets you click the circle to edit minutes and seconds. It starts on blur: Enter from either field or forward Tab from seconds starts the countdown and leaves focus on the page. Keyboard handling is provided by input-duration; the demo starts the countdown when editing ends.

The GitHub Pages workflow builds and deploys the demo when changes are pushed to main.