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-timepicker-arc

v2.0.3

Published

A flexible and customizable React TimePicker component with multiple format support

Readme

React Timepicker Arc (RTA)

A flexible and customizable React TimePicker and ClockPicker component with multiple format support, TypeScript support, and extensive customization options.

🖼️ Live Examples Screenshots

TimePicker Screenshot ClockPicker Screenshot

Documentation

🌐 Full Documentation & Live Examples

👉 Open Documentation - Complete guide with interactive examples


⚠️ BREAKING CHANGES in v2.0.0

🚨 IMPORTANT: The import syntax has completely changed in v2.0.0. If you're upgrading from a previous version, you must update your imports!

❌ Old Import (v1.0.1) - DEPRECATED

// This will NOT work in v2.0.0+
import TimePicker from "react-timepicker-arc";
import "react-timepicker-arc/dist/TimePicker.css";

✅ New Import (v2.0.0+) - REQUIRED

// Use this new syntax for v2.0.0+
import { TimePicker, ClockPicker } from "react-timepicker-arc";
import "react-timepicker-arc/dist/index.css";

✨ Features

  • 🕐 Multiple time formats (12/24 hour)
  • ⏱️ Optional seconds display (TimePicker only)
  • 🌅 AM/PM toggle
  • 📝 Multiple return types (time-string, iso-string, datetime-string, unix-seconds, unix-milliseconds, date-object)
  • 🎨 Customizable styling through classNames prop
  • 📍 Positioning options (top, bottom, left, right, center)
  • ✅ Built-in validation and error handling
  • 🖼️ Custom icons support
  • 🔘 Customizable buttons
  • 📦 TypeScript support
  • 🌳 Tree-shaking friendly

Note: ClockPicker does not include a seconds selector. Seconds are supported only in TimePicker.


📦 Installation

npm install react-timepicker-arc

🔧 Usage

Basic Usage – TimePicker

import { TimePicker } from "react-timepicker-arc";
import "react-timepicker-arc/dist/index.css";
import { useState } from "react";

export default function App() {
  const [value, setValue] = useState("");

  return (
    <TimePicker
      value={value}
      setValue={setValue}
      onTimeChange={(time, isValid) => {
        console.log("Time:", time, "Valid:", isValid);
      }}
      showSeconds={true} // optional in TimePicker only
    />
  );
}

Basic Usage – ClockPicker

import { ClockPicker } from "react-timepicker-arc";
import "react-timepicker-arc/dist/index.css";
import { useState } from "react";

export default function App() {
  const [value, setValue] = useState("");

  return (
    <ClockPicker
      value={value}
      setValue={setValue}
      onTimeChange={(time, isValid) => {
        console.log("Time:", time, "Valid:", isValid);
      }}
      // showSeconds is not available in ClockPicker
    />
  );
}

⚙️ Props Overview

| Prop | Type | Default | Description | | ------------------- | ---------------------------------------------------- | ------------------ | ----------------------------------------- | | value | string \| number \| Date \| null \| undefined | undefined | The initial time value | | setValue | (value: any) => void | (value) => value | Function called when time changes | | onTimeChange | (time: string, isValid: boolean) => void | undefined | Callback when time changes | | showSeconds | boolean (TimePicker only) | false | Whether to show seconds (TimePicker only) | | showButtons | boolean | true | Whether to show OK/Cancel buttons | | is12HourFormat | boolean | true | Use 12-hour format | | showAMPM | boolean | true | Show AM/PM selector | | align | "bottom" \| "top" \| "left" \| "right" \| "center" | "bottom" | Picker alignment | | placeholder | string | Auto-generated | Input placeholder text | | className | string | "" | Additional CSS class | | returnType | TimePickerReturnType | Auto-detected | Format of returned value | | id | string | "arc_timepicker" | Input element ID | | icon | ReactNode | Default clock icon | Custom icon element | | cancelButtonText | string | "Cancel" | Cancel button text | | confirmButtonText | string | "OK" | Confirm button text | | classNames | object | {} | Custom CSS classes for components |

📝 Return Types

  • "time-string": "11:30 PM"
  • "iso-string": "2022-04-17T15:30:45"
  • "datetime-string": "04/17/2022 3:30:45 PM"
  • "unix-seconds": 1650207045
  • "unix-milliseconds": 1650207045000
  • "date-object": Date object

🎨 ClassNames Object

{
  wrapper?: string;
  inputWrapper?: string;
  input?: string;
  icon?: string;
  listsMainWrapper?: string;
  listsWrapper?: string;
  lists?: string;
  list?: string;
  listSelected?: string;
  buttons?: string;
  button?: string;
  buttonCancel?: string;
  buttonConfirm?: string;
}

Custom Styling Example

<TimePicker
  classNames={{
    wrapper: "my-timepicker",
    input: "my-input",
    listSelected: "my-selected-item",
  }}
  // Your custom CSS will override default styles
/>

🚀 Migration Guide (v1.0.1 → v2.0.0)

Step 1: Update Your Imports

// ❌ Before (v1.0.1)
import TimePicker from "react-timepicker-arc";
import "react-timepicker-arc/dist/TimePicker.css";

// ✅ After (v2.0.0+)
import { TimePicker } from "react-timepicker-arc";
import "react-timepicker-arc/dist/index.css";

Step 2: Choose Your Component

// Option 1: TimePicker (with seconds support)
import { TimePicker } from "react-timepicker-arc";

// Option 2: ClockPicker (visual clock, no seconds)
import { ClockPicker } from "react-timepicker-arc";

Step 3: Update CSS Import

  • Old: "react-timepicker-arc/dist/TimePicker.css"
  • New: "react-timepicker-arc/dist/index.css"

🆕 What's New in v2.0.0

New Features

  • ClockPicker Component: Brand new visual clock interface
  • Enhanced UI: Completely redesigned user interface
  • Better TypeScript Support: Improved type definitions
  • Named Exports: Tree-shaking friendly imports

Component Differences

| Feature | TimePicker | ClockPicker | | ----------------- | ---------- | ----------- | | Seconds Support | ✅ | ❌ | | Visual Interface | List-based | Clock-based | | Touch Friendly | ✅ | ✅ | | Mouse Interaction | ✅ | ✅ |

📝 License

MIT © Hridoy Haque