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> | undefined—Ref to the am/pm input host node.
amPmSelectPropsPartial<AmPmInputProps> | undefined—Props spread onto the am/pm segment (`AmPmInput`); picker wiring wins.
clearableboolean | undefinedfalseShow a clear button when filled.
clearButtonPropsCloseButtonProps | undefined—Props passed down to the clear button.
defaultValuestring | undefined—Uncontrolled default value.
descriptionReactNode—Description rendered below the label.
disabled systemboolean | undefined—If set, the component becomes disabled.
errorReactNode—Error message / state.
formstring | undefined—`form` id forwarded to the hidden form input (web only).
formatTimePickerFormat | undefined
24h · 12h
'24h'Time format.
hiddenInputPropsTimePickerHiddenInputProps | undefined—Props forwarded to the hidden form input (web only).
hoursInputLabelstring | undefined—`aria-label` of the hours input.
hoursInputPropsPartial<SpinInputProps> | undefined—Props 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> | undefined—Ref to the hours input host node.
hoursStepnumber | undefined1Number by which hours are incremented/decremented.
labelReactNode—Field label rendered above the input.
maxstring | undefined—Max possible time value in `hh:mm:ss` format.
maxDropdownContentHeightnumber | undefined200Maximum dropdown content height in px.
minstring | undefined—Min 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> | undefined—Props spread onto the minutes segment (`SpinInput`); picker wiring wins.
minutesPlaceholderstring | undefined'--'Minutes input placeholder.
minutesRefRef<TamaguiElement> | undefined—Ref 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> | undefined—Called once when focus leaves the field.
onChange((value: string) => void) | undefined—Called when the value changes.
onFocusFocusEventHandler<HTMLInputElement> | undefined—Called once when the field gains focus (not between segments).
onKeyDown((event: TimePickerKeyDownEvent) => void) | undefined—Called 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">> | undefined—Props passed down to the `Popover`.
presetsTimePickerPresets | undefined—Time presets to display in the dropdown.
readOnlyboolean | undefined—If set, the value cannot be updated.
requiredboolean | undefined—Mark the field as required (adds the asterisk to the label).
reverseTimeControlsListboolean | undefinedfalseReverse the order of the time-controls lists.
rightSectionReactNode—Content rendered in the right section of the field.
scrollAreaPropsScrollAreaProps | undefined—Props passed down to all underlying `ScrollArea` components.
secondsInputLabelstring | undefined—`aria-label` of the seconds input.
secondsInputPropsPartial<SpinInputProps> | undefined—Props spread onto the seconds segment (`SpinInput`); picker wiring wins.
secondsPlaceholderstring | undefined'--'Seconds input placeholder.
secondsRefRef<TamaguiElement> | undefined—Ref 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> | undefined—Per-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 | undefined—Applies a theme to this element
typeTimePickerType | undefined
time · duration
'time'TimePicker type: `'time'` for a clock input, `'duration'` for >24h durations.
valuestring | undefined—Controlled 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.

SlotTargets
colonProps for the : separators between segments.
descriptionThe Input.Description.
dropdownProps for the dropdown content container (the controls/presets Box).
errorThe Input.Error.
fieldProps for the bordered field row that holds the segments (.Field).
labelThe Input.Label.
requiredThe required asterisk Text inside the label.
segmentProps spread onto EVERY editable time segment (SpinInput); xxxInputProps win.
wrapperThe outer InputWrapperFrame column.
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.

Edit this page on GitHub