Knit UI
GitHub

Playground

Loading playground…

false
false
false
false
false
Playground
<TimePicker
  type="time"
  format="24h"
  withSeconds={false}
  withDropdown={false}
  clearable={false}
  size="sm"
/>

Examples

Default

Default 24h field with a label.

Loading example…

DefaultSourceStorybook

Twelve Hour

12h format adds the am/pm segment.

Loading example…

Twelve HourSourceStorybook

With Seconds

With the seconds segment.

Loading example…

With SecondsSourceStorybook

Duration

type="duration" allows hours beyond 24 and forces 24h (no am/pm).

Loading example…

DurationSourceStorybook

With Dropdown

The time-controls dropdown opens on focus when withDropdown is set.

Loading example…

With DropdownSourceStorybook

With Presets

Quick presets shown in the dropdown.

Loading example…

With PresetsSourceStorybook

Clearable

Clearable — a clear button appears once a value is set.

Loading example…

ClearableSourceStorybook

With Bounds

Bounded — the value clamps into [min, max] when focus leaves the field.

Loading example…

With BoundsSourceStorybook

With Validation

Required field with a description and an error message.

Loading example…

With ValidationSourceStorybook

States

Read-only and disabled states.

Loading example…

StatesSourceStorybook

Sizes

Every size token.

Loading example…

SizesSourceStorybook

Slot Styles Sugar

Per-slot styles sugar — props spread onto the composed parts.

Loading example…

Slot Styles SugarSourceStorybook

Props

PropTypeDefaultDescription
amPmInputLabelstring | undefined`aria-label` of the am/pm input.
amPmLabelsTimePickerAmPmLabels | undefined{ am: 'AM', pm: 'PM' }Labels used for am/pm values.
amPmRefRef<TamaguiElement> | undefinedRef to the am/pm input host node.
amPmSelectPropsPartial<AmPmInputProps> | undefinedProps spread onto the am/pm segment (`AmPmInput`); picker wiring wins.
clearableboolean | undefinedfalseShow a clear button when filled.
clearButtonPropsCloseButtonProps | undefinedProps passed down to the clear button.
defaultValuestring | undefinedUncontrolled default value.
descriptionReactNodeDescription rendered below the label.
disabled systemboolean | undefinedIf set, the component becomes disabled.
errorReactNodeError message / state.
formstring | undefined`form` id forwarded to the hidden form input (web only).
formatTimePickerFormat | undefined
24h · 12h
'24h'Time format.
hiddenInputPropsTimePickerHiddenInputProps | undefinedProps forwarded to the hidden form input (web only).
hoursInputLabelstring | undefined`aria-label` of the hours input.
hoursInputPropsPartial<SpinInputProps> | undefinedProps spread onto the hours segment (`SpinInput`) — e.g. a per-segment test id or `aria-label`. Typed to OUR `SpinInput` props (NOT a web-only `React.ComponentProps<'input'>`); the picker's own wiring always wins.
hoursPlaceholderstring | undefined'--'Hours input placeholder.
hoursRefRef<TamaguiElement> | undefinedRef to the hours input host node.
hoursStepnumber | undefined1Number by which hours are incremented/decremented.
labelReactNodeField label rendered above the input.
maxstring | undefinedMax possible time value in `hh:mm:ss` format.
maxDropdownContentHeightnumber | undefined200Maximum dropdown content height in px.
minstring | undefinedMin possible time value in `hh:mm:ss` format.
minHoursDigitsnumber | undefined2Minimum number of hour digits, `type="duration"` only.
minutesInputLabelstring | undefined`aria-label` of the minutes input.
minutesInputPropsPartial<SpinInputProps> | undefinedProps spread onto the minutes segment (`SpinInput`); picker wiring wins.
minutesPlaceholderstring | undefined'--'Minutes input placeholder.
minutesRefRef<TamaguiElement> | undefinedRef to the minutes input host node.
minutesStepnumber | undefined1Number by which minutes are incremented/decremented.
namestring | undefined`name` forwarded to the hidden form input so a surrounding `<form>` submits the time (web only).
onBlurFocusEventHandler<HTMLDivElement> | undefinedCalled once when focus leaves the field.
onChange((value: string) => void) | undefinedCalled when the value changes.
onFocusFocusEventHandler<HTMLInputElement> | undefinedCalled once when the field gains focus (not between segments).
onKeyDown((event: TimePickerKeyDownEvent) => void) | undefinedCalled on keydown anywhere in the field (web: the bubbled segment keydown). Used by `InlineDateTimePicker` to commit on Enter; inert on native.
pasteSplitTimePickerPasteSplit | undefinedgetParsedTimeTransform a pasted value into time segments.
popoverPropsPartial<Omit<PopoverProps, "children">> | undefinedProps passed down to the `Popover`.
presetsTimePickerPresets | undefinedTime presets to display in the dropdown.
readOnlyboolean | undefinedIf set, the value cannot be updated.
requiredboolean | undefinedMark the field as required (adds the asterisk to the label).
reverseTimeControlsListboolean | undefinedfalseReverse the order of the time-controls lists.
rightSectionReactNodeContent rendered in the right section of the field.
scrollAreaPropsScrollAreaProps | undefinedProps passed down to all underlying `ScrollArea` components.
secondsInputLabelstring | undefined`aria-label` of the seconds input.
secondsInputPropsPartial<SpinInputProps> | undefinedProps spread onto the seconds segment (`SpinInput`); picker wiring wins.
secondsPlaceholderstring | undefined'--'Seconds input placeholder.
secondsRefRef<TamaguiElement> | undefinedRef to the seconds input host node.
secondsStepnumber | undefined1Number by which seconds are incremented/decremented.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size systemTimePickerSize | undefined
xs · sm · md · lg · xl
'sm'Field size — the kit input size scale.
styles systemSlotStyles<TimePickerStyles> | undefinedPer-slot style sugar — props spread onto the matching styled part. Slots: `field` / `segment` / `colon` / `dropdown` plus the `Input.Wrapper` chrome (`wrapper` / `label` / `description` / `error` / `required`). The explicit `xxxInputProps` / `popoverProps` / `clearButtonProps` passthroughs win over it.
theme systemThemeName | null | undefinedApplies a theme to this element
typeTimePickerType | undefined
time · duration
'time'TimePicker type: `'time'` for a clock input, `'duration'` for >24h durations.
valuestring | undefinedControlled value — an `HH:mm[:ss]` string.
variant systemInputVariant | undefined
default · filled · unstyled
'default'Field variant forwarded to the field frame.
withDropdownboolean | undefinedfalseOpen a time-controls dropdown on focus.
withSecondsboolean | undefinedfalseShow the seconds segment.

Style slots

Every part of TimePicker can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
colonstyles={{ colon: { … } }}
descriptionstyles={{ description: { … } }}
dropdownstyles={{ dropdown: { … } }}
errorstyles={{ error: { … } }}
fieldstyles={{ field: { … } }}
labelstyles={{ label: { … } }}
requiredstyles={{ required: { … } }}
segmentstyles={{ segment: { … } }}
wrapperstyles={{ wrapper: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 493 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.