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

@xsolla/xui-input-time

v0.148.2

Published

A structured time input component for entering hours, minutes, and optionally seconds. Supports 12h and 24h formats with an optional AM/PM toggle. Cross-platform (web and React Native).

Downloads

3,628

Readme

Input Time

A structured time input component for entering hours, minutes, and optionally seconds. Supports 12h and 24h formats with an optional AM/PM toggle. Cross-platform (web and React Native).

Installation

npm install @xsolla/xui-input-time
# or
yarn add @xsolla/xui-input-time

Demo

Basic Usage

import * as React from 'react';
import { InputTime } from '@xsolla/xui-input-time';
import type { TimeValue } from '@xsolla/xui-input-time';

export default function BasicTime() {
  const [value, setValue] = React.useState<TimeValue | null>(null);

  return <InputTime value={value} onChange={setValue} />;
}

With Seconds

import * as React from 'react';
import { InputTime } from '@xsolla/xui-input-time';
import type { TimeValue } from '@xsolla/xui-input-time';

export default function WithSeconds() {
  const [value, setValue] = React.useState<TimeValue | null>(null);

  return <InputTime value={value} onChange={setValue} showSeconds />;
}

12-Hour Format with AM/PM

import * as React from 'react';
import { InputTime } from '@xsolla/xui-input-time';
import type { TimeValue } from '@xsolla/xui-input-time';

export default function TwelveHour() {
  const [value, setValue] = React.useState<TimeValue | null>({
    hours: 3,
    minutes: 30,
    period: 'pm',
  });

  return (
    <InputTime
      value={value}
      onChange={setValue}
      hourCycle={12}
      showPeriod
    />
  );
}

Custom Icon

A Clock icon is displayed by default. Pass a custom icon via the icon prop, or set icon={null} to hide it.

import * as React from 'react';
import { InputTime } from '@xsolla/xui-input-time';
import { Clock } from '@xsolla/xui-icons-base';
import type { TimeValue } from '@xsolla/xui-input-time';

export default function CustomIcon() {
  const [value, setValue] = React.useState<TimeValue | null>(null);

  return (
    <InputTime
      value={value}
      onChange={setValue}
      icon={<Clock variant="solid" />}
    />
  );
}

Different Sizes

import * as React from 'react';
import { InputTime } from '@xsolla/xui-input-time';

export default function Sizes() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
      <InputTime size="xl" />
      <InputTime size="lg" />
      <InputTime size="md" />
      <InputTime size="sm" />
      <InputTime size="xs" />
    </div>
  );
}

API Reference

InputTime

InputTimeProps:

| Prop | Type | Default | Description | | :--- | :--- | :------ | :---------- | | value | TimeValue \| null | - | Current time value. | | onChange | (value: TimeValue \| null) => void | - | Time change callback. | | showSeconds | boolean | false | Show seconds segment (HH:MM:SS). | | showPeriod | boolean | false | Show AM/PM toggle. | | hourCycle | 12 \| 24 | 24 | Hour format (12h or 24h). | | icon | ReactNode | <Clock /> | Icon displayed on the left. Set to null to hide. | | size | "xl" \| "lg" \| "md" \| "sm" \| "xs" | "md" | Input size variant. | | disabled | boolean | false | Disable the input. | | error | string | - | Error message (shows error state). | | aria-label | string | "Time input" | Accessible label. | | testID | string | - | Test identifier. |

TimeValue

| Property | Type | Description | | :--- | :--- | :---------- | | hours | number | Hours (0-23 for 24h, 1-12 for 12h). | | minutes | number | Minutes (0-59). | | seconds | number (optional) | Seconds (0-59). Present when showSeconds is true. | | period | "am" \| "pm" (optional) | Time period. Present when showPeriod is true. |

Keyboard Navigation

| Key | Action | | :--- | :--- | | 0-9 | Type digit. Auto-advances to next segment after 2 digits. | | Tab | Move to next segment. | | Shift+Tab | Move to previous segment. | | ArrowUp | Increment focused segment by 1. | | ArrowDown | Decrement focused segment by 1. | | ArrowRight | Move to next segment. | | ArrowLeft | Move to previous segment. | | Backspace | Clear segment and move back. |

Validation

Values are clamped to valid ranges automatically:

  • Hours: 0-23 (24h) or 1-12 (12h)
  • Minutes: 0-59
  • Seconds: 0-59

Accessibility

  • Each segment has an aria-label ("Hours", "Minutes", "Seconds")
  • Error messages use role="alert"
  • AM/PM toggle is a button with descriptive aria-label
  • Segments are grouped with role="group"