SwipeUI

Time picker

OS-native time entry or accessible custom snap wheels with explicit wall-clock values.

npx @swipeui/cli add time-picker
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Setting alarms, reminders, appointments or opening hours.
  • Using the system time picker people already know.
  • Custom snap wheels that match your theme, with minute steps like 5 or 15.

When not to use it

  • Date and time together; pair Date picker with Time picker.
  • Durations such as 1h 30m. Use Number field.
  • Very coarse choices, like Morning or Evening. Use Segmented control.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add time-picker
  • Adds components/swipeui/ui/use-time-picker.ts, components/swipeui/ui/time-picker.tsx and 20 shared helpers.
  • Installs react-native-svg, @expo/ui, uniwind, react-native-reanimated, react-native-worklets, expo-haptics, clsx, tailwind-merge, class-variance-authority, react-native-gesture-handler, react-native-safe-area-context, @gorhom/bottom-sheet, expo-blur. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/reminders.tsx
import { TimePicker } from '@/components/swipeui/ui/time-picker';

<TimePicker label="Reminder" minuteInterval={5} />;

Examples

Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.

API reference

TimePickerProps

PropTypeDefaultDescription
success?string—

Confirmation, such as "Username available". Replaces the helper; an error replaces it.

status?FieldStatus'idle'

Validation state the control shows: a spinner while validating, a check when valid. An error implies invalid.

required?booleanfalse

Whether a value is required.

disabledStyle?FieldDisabledStyle'muted'

muted lightens the field without opacity; dim lowers the whole field to 50%.

appearance?FieldAppearancethe control's own default ('filled')

Surface look passed to the control.

size?FieldSizethe control's own default ('md')

Control size passed to the control.

shape?FieldShapethe control's own default ('preset')

Control shape passed to the control.

labelPlacement?FieldLabelPlacement'above'

Where the label sits. inset and floating are drawn inside the control by Text field and Field trigger.

focusRing?FieldFocusRingthe control's own default ('halo')

Focus indicator passed to the control.

weekStartsOn?"locale" | WeekStart1

First day of the week, Sunday = 0, or locale to follow the locale's week where the engine reports it (browsers do; Hermes doesn't, so it falls back to Monday). Monday by default, so the app and the web match.

locale?stringthe device's

Locale for month and weekday names.

labelstring—

Visible and spoken field label.

engine?"custom" | "native"'native'

Native OS picker or token-aware calendar.

open?boolean—

Controlled presentation.

defaultOpen?booleanfalse

Initial presentation.

onOpenChange?((open: boolean) => void)—

Reports opening, confirmation or dismissal.

placeholder?string'Choose a date'

Empty trigger text.

helper?string—

Supporting instructions.

error?string—

Validation message.

disabled?booleanfalse

Prevent opening and selection.

motion?MotionOverride—

Custom engine motion; native owns its motion.

haptics?booleantrue

Trigger feedback.

closeOnSelect?booleantrue

Close shortly after selecting a date.

closeDelay?number250

Content delay before closing in milliseconds.

shortcuts?unionfalse

Enable default shortcuts or supply named local dates.

format?Intl.DateTimeFormatOptions | ((date: Date) => string)—

Intl options or your own formatter.

clearable?booleanfalse

Show an external clear action.

messages?object—

Shortcut and clear labels.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Native layout escape hatch.

testID?string—

Trigger ID.

minuteInterval?number1

Minute detents, a positive divisor of 60. Custom engine only.

is24Hour?booleantrue

Custom/Android hour display style; native iOS follows locale/system settings.

value?T | null—

Canonical HH:mm value; 1.x object values remain accepted.

defaultValue?T | nullnull

Initial wall-clock value.

onValueChange?((value: T | null) => void)—

Reports a canonical string, or object for a legacy object input.

presentation?"list" | "native" | "wheel"'list'

List, flat wheel, or the native engine.

minuteStep?number15

Positive divisor of 60.

hourCycle?"auto" | "h12" | "h23"'auto'

Locale cycle or explicit 12/24-hour display.

minTime?string—

Earliest wall-clock choice, inclusive.

maxTime?string—

Latest wall-clock choice, inclusive.

Native view/input props not listed here pass through where the exported TypeScript type allows them.

Time picker settings

PropDoesDefault
hapticsEnables selection or press feedbacktrue
motionOverrides the app's motion feelApp feel

| presentation | native, list or flat wheel | list | | minuteStep | Positive divisor of 60 | 15 | | hourCycle | auto, h12 or h23 | auto | | minTime / maxTime | Inclusive HH:mm bounds | — | | clearable | Clear the value | false |

New values are HH:mm strings with no date/timezone conversion. Explicit 1.x engine and object values retain their Apply/Cancel adapter. Hour-cycle detection uses resolvedOptions, with a Hermes-safe fallback.

Composition and behavior

  • A labelled field that opens the OS picker or custom wheels.
  • minuteInterval and is24Hour shape the custom wheels.
  • value and onValueChange hold the confirmed time.

Engine support

CapabilityNative iOSNative AndroidCustom iOS/Android
Requested localeYesOS-owned / unsupportedYes
Shared custom motionOS-owned / unsupportedOS-owned / unsupportedYes
Preset colours and shapesOS-owned / unsupportedOS-owned / unsupportedYes
Disabled-date predicateOS-owned / unsupportedOS-owned / unsupportedYes
Requested 12/24-hour displayOS-owned / unsupportedYesYes
Minute intervalsOS-owned / unsupportedOS-owned / unsupportedYes

Native iOS is inline inside the sheet; Android uses an OS dialog. Native iOS follows locale/system hour settings. Custom minute intervals must divide 60. Acceptance always checks date constraints, but the native engine cannot visually disable arbitrary dates. Static adapter support does not establish native runtime compatibility.

Behavior and gestures

  • Tap the field to open the native picker or custom wheels in a sheet.
  • Scroll the hour and minute wheels; they snap into place with a light tick.
  • Apply confirms the time; Cancel discards the change.
  • The custom engine supports minute steps and 12- or 24-hour display.

Accessibility

  • Each wheel is adjustable with VoiceOver swipe gestures or increment and decrement.
  • The field reads its label and time, and reports expanded state.
  • Apply is labelled with the field name.
  • Times are wall-clock values with no hidden time zone conversion.

Motion

  • Uses the overlay and press motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • Wheels snap natively; the sheet uses the overlay role.
  • Reduce Motion fades the sheet.

Performance

  • Wheels are native scroll views snapping to rows.

Notes for AI

  • Values are { hour, minute }; minuteInterval must divide 60.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items