
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-timepicker-c
Advanced tools
A lightweight, accessible timepicker component for React with full keyboard navigation and CSS customization
A lightweight, accessible timepicker component for React with full keyboard navigation and CSS customization.
npm install react-timepicker-c
import { useState } from "react";
import { TimePicker } from "react-timepicker-c";
import "react-timepicker-c/styles.css";
function App() {
const [time, setTime] = useState("");
return (
<TimePicker
value={time}
onChange={setTime}
minTime="9:00am"
maxTime="5:00pm"
interval={30}
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | Required | Current time value (e.g., "2:30pm") |
onChange | (time: string) => void | Required | Callback when time changes |
minTime | string | "12:00am" | Minimum selectable time |
maxTime | string | "11:59pm" | Maximum selectable time |
interval | number | 30 | Interval between options (minutes) |
error | boolean | false | Show error state |
errorMessage | string | "Please enter a valid time" | Error message text |
placeholder | string | "Select time" | Input placeholder |
disabled | boolean | false | Disabled state |
name | string | - | Input name attribute |
id | string | - | Input id attribute |
className | string | - | Additional CSS class |
aria-label | string | - | Accessible label |
Customize the appearance using CSS custom properties:
.timepicker {
--timepicker-bg: #1a1a1a;
--timepicker-text: #ffffff;
--timepicker-border: #333333;
--timepicker-border-focus: #0ea5e9;
--timepicker-hover-bg: #2a2a2a;
--timepicker-selected-bg: #0ea5e9;
--timepicker-selected-text: #ffffff;
--timepicker-error: #f43f5e;
--timepicker-radius: 8px;
--timepicker-font-size: 16px;
}
| Variable | Description |
|---|---|
--timepicker-bg | Background color |
--timepicker-text | Text color |
--timepicker-text-secondary | Placeholder text color |
--timepicker-border | Border color |
--timepicker-border-focus | Focus border color |
--timepicker-hover-bg | Option hover background |
--timepicker-selected-bg | Selected option background |
--timepicker-selected-text | Selected option text color |
--timepicker-error | Error state color |
--timepicker-radius | Border radius |
--timepicker-shadow | Dropdown shadow |
--timepicker-font-family | Font family |
--timepicker-font-size | Font size |
--timepicker-input-height | Input height |
--timepicker-dropdown-max-height | Max dropdown height |
--timepicker-z-index | Dropdown z-index |
| Key | Action |
|---|---|
↓ | Open dropdown / Move to next option |
↑ | Open dropdown / Move to previous option |
Enter | Select highlighted option |
Escape | Close dropdown |
Tab | Close dropdown and move focus |
The package also exports utility functions for advanced use cases:
import {
parseTime,
formatTime,
generateTimeRange,
isValidTime
} from "react-timepicker-c";
// Parse time string to { hours, minutes }
parseTime("2:30pm"); // { hours: 14, minutes: 30 }
// Format back to string
formatTime({ hours: 14, minutes: 30 }); // "2:30pm"
// Generate time options
generateTimeRange("9:00am", "5:00pm", 60);
// ['9:00am', '10:00am', '11:00am', ...]
// Validate time string
isValidTime("2:30pm"); // true
timeValue → valuehasTimeError → errorimport TimePicker from "react-timepicker-c";
<TimePicker timeValue={time} onChange={handleChange} hasTimeError={hasError} />;
import { TimePicker } from "react-timepicker-c";
import "react-timepicker-c/styles.css";
<TimePicker value={time} onChange={handleChange} error={hasError} />;
MIT © nosisky
FAQs
A lightweight, accessible timepicker component for React with full keyboard navigation and CSS customization
We found that react-timepicker-c demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.