Skip to content

TimePicker

The TimePicker suite mirrors the DatePicker API for time selection, offering consistent wheel-based time picking across multiple presentation styles.

Components

ComponentDescription
TimePickerCore time picker with hour/minute/period columns
TimePickerCardInline card with confirm/cancel actions
TimePickerModalFull-screen modal presentation
TimePickerDialogAlert-style dialog presentation
TimePickerInputPressable input field that opens a modal

Usage

TimePickerExample.tsx
import { useState } from 'react';
import { TimePickerInput } from '@masumdev/rn-ui';
export function TimePickerExample() {
const [time, setTime] = useState<Date | undefined>();
return (
<TimePickerInput
title="SET TIME"
placeholder="Select time"
value={time}
onChange={setTime}
/>
);
}

Props API

PropTypeDefaultDescription
valueDate | undefinedSelected time value.
onChange(time: Date) => voidCallback when time is confirmed.
placeholderstringPlaceholder text when no time selected.
titlestringTitle shown in the modal header.
use24HourbooleanfalseUse 24-hour format instead of AM/PM.
minuteIntervalnumber1Minute step interval (1, 5, 10, 15, 30).
disabledbooleanfalseDisable the input.

Utilities

import { formatTime } from '@masumdev/rn-ui';
// Format a Date to display string
formatTime(new Date(), { use24Hour: false }); // "2:30 PM"