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

timepicker-ui

v4.3.0

Published

timepicker-ui is a customizable time picker library built with TypeScript, inspired by Google's Material Design. Lightweight, themeable, and easy to integrate.

Readme

timepicker-ui

Highly customizable time picker UI library for JavaScript and modern frameworks (React, Vue, Angular), with clock and wheel modes, zero dependencies, and full SSR support.

npm version downloads license Coverage Status Tests Socket Badge

Live DemoDocumentationChangelogReact Wrapper

Why timepicker-ui?

  • Zero dependencies - no runtime deps, smaller bundle, no supply-chain risk
  • Multiple UI modes - analog clock, scroll wheel, compact popover - not just one layout
  • Plugin architecture - range, timezone, wheel - import only what you need
  • SSR safe - works in Next.js, Nuxt, Remix, Astro out of the box
  • Any framework - React, Vue, Angular, Svelte, or plain JS - same API everywhere
  • Accessible - ARIA, keyboard nav, focus trap, screen reader support

Use Cases

  • Booking forms, scheduling, reservations
  • Admin panels and dashboards
  • Mobile-first apps with touch/scroll UX
  • Time range selection (via Range plugin)
  • SSR applications (Next.js, Nuxt, Remix, Astro)

Compared to Other Libraries

| | timepicker-ui | Typical UI lib | | ----------------- | -------------------------------- | -------------------------- | | Dependencies | 0 | 1-10+ | | UI modes | Clock + Wheel + Compact | Clock only | | Plugin system | Yes (range, timezone, wheel) | No | | Framework lock-in | None - works everywhere | Often React-only | | SSR safe | Yes, out of the box | Often requires workarounds | | Tree-shakeable | Yes - plugins excluded if unused | Varies |

Features

Installation

Full guide: Installation docs

npm install timepicker-ui

Quick Start

Full guide: Quick Start docs

<input id="timepicker" type="text" />
import { TimepickerUI } from "timepicker-ui";
import "timepicker-ui/main.css";

const input = document.querySelector("#timepicker");
const picker = new TimepickerUI(input, {
  clock: { type: "24h" },
  ui: { theme: "dark" },
  callbacks: {
    onConfirm: (data) => console.log("Selected:", data),
  },
});
picker.create();

Note - Requires global box-sizing: border-box (included by default in most frameworks) .

API

Full reference: Methods · Events · TypeScript

picker.create();           // Initialize
picker.open();             // Open programmatically
picker.close();            // Close
picker.destroy();          // Clean up
picker.getValue();         // Get current time string
picker.setValue("14:30");  // Set time
picker.update({ ... });    // Update options at runtime

// Events
picker.on("confirm", (data) => {});
picker.on("cancel", (data) => {});
picker.on("open", () => {});
picker.on("update", (data) => {});
picker.on("clear", (data) => {});
picker.on("error", (data) => {});
picker.once("confirm", handler);
picker.off("confirm", handler);

// Static
TimepickerUI.getById("my-id");
TimepickerUI.getAllInstances();
TimepickerUI.destroyAll();

Options Overview

Options are grouped into logical namespaces. Full reference: Options docs · Configuration guide

new TimepickerUI(input, {
  clock: {
    type: "12h" | "24h",        // default: "12h"
    incrementHours: 1,
    incrementMinutes: 1,
    disabledTime: { hours: [], minutes: [], interval: "" },
    currentTime: boolean | object,
  },
  ui: {
    theme: "basic" | "dark" | "m3-green" | "crane" | ...,  // 10 themes
    mode: "clock" | "wheel" | "compact-wheel",             // default: "clock"
    animation: true,
    backdrop: true,
    mobile: false,
    editable: false,
    inline: { enabled: false, containerId: "", showButtons: true, autoUpdate: false },
    clearButton: false,
    cssClass: "",
  },
  labels: { am, pm, ok, cancel, time, mobileTime, mobileHour, mobileMinute, clear },
  behavior: { focusTrap: true, focusInputAfterClose: false, delayHandler: 300, id: "" },
  callbacks: { onConfirm, onCancel, onOpen, onUpdate, onSelectHour, onSelectMinute, onSelectAM, onSelectPM, onError, onClear },
  wheel: { placement: "auto" | "top" | "bottom", hideFooter: false, commitOnScroll: false, hideDisabled: false, ignoreOutsideClick: false },
});

Themes

Browse all themes: Theme docs · Live examples · Custom styling

Available: basic, crane, crane-straight, m3-green, m2, dark, glassmorphic, pastel, ai, cyberpunk

import "timepicker-ui/main.css"; // always required
import "timepicker-ui/theme-dark.css"; // theme-specific stylesheet

new TimepickerUI(input, { ui: { theme: "dark" } });

Plugins

Docs: Plugins overview · Examples: Range · Timezone · Wheel

import { TimepickerUI, PluginRegistry } from "timepicker-ui";
import { RangePlugin } from "timepicker-ui/plugins/range";
import { TimezonePlugin } from "timepicker-ui/plugins/timezone";
import { WheelPlugin } from "timepicker-ui/plugins/wheel";

// Register once at app startup
PluginRegistry.register(RangePlugin);
PluginRegistry.register(TimezonePlugin);
PluginRegistry.register(WheelPlugin);

new TimepickerUI(input, { range: { enabled: true } });

Upgrading

Framework Integration

Full examples: React · Vue / Angular / Svelte

React (quick example)

import { useEffect, useRef } from "react";
import { TimepickerUI } from "timepicker-ui";
import "timepicker-ui/main.css";

function TimePicker() {
  const ref = useRef<HTMLInputElement>(null);
  useEffect(() => {
    if (!ref.current) return;
    const picker = new TimepickerUI(ref.current);
    picker.create();
    return () => picker.destroy();
  }, []);
  return <input ref={ref} />;
}

There is also a dedicated React wrapper package.

Performance

  • Tree-shakeable - unused plugins are fully excluded from the bundle
  • Lightweight core - with tree-shaking support
  • Plugins loaded on demand - range, timezone, wheel add size only when imported
  • No runtime dependencies - nothing extra to download or audit

Development

See app/README.md for local development setup.

Contributing

Contributions welcome! Open an issue or PR.

License

MIT © Piotr Glejzer