Knit UI
GitHub

Playground

Loading playground…

true
false
false
Playground
<AmPmInput
  focusable
/>

Examples

Default

Default empty segment, showing the -- placeholder.

Loading example…

DefaultSourceStorybook

Filled

A pre-selected value.

Loading example…

FilledSourceStorybook

Read Only

Read-only — edits and keyboard input are rejected.

Loading example…

Read OnlySourceStorybook

Disabled

Disabled — dimmed and non-interactive.

Loading example…

DisabledSourceStorybook

Localized

Localized labels — typed first letters match the localized strings (vm/nm).

Loading example…

LocalizedSourceStorybook

Props

PropTypeDefaultDescription
focusable requiredbooleantrueWhether the field is in the tab order.
labels requiredTimePickerAmPmLabels—Localized am/pm labels matched against typed first letters.
onChange required(value: string) => void—Called when the segment changes (cleared → `''`).
value requiredstring—Current am/pm label, or `''` when empty.
disabled systemboolean | undefined—Whether the field is disabled.
onNextInput(() => void) | undefined—Advance focus to the next segment (after a letter sets am/pm, ArrowRight).
onPreviousInput(() => void) | undefined—Return focus to the previous segment (Backspace when empty / ArrowLeft).
radius systemstring | number | undefined—Key of theme radius or a valid CSS value to set border-radius
readOnlyboolean | undefined—Whether the field rejects edits.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined——
size systemInputSize | undefined"sm"Controls input height, horizontal padding, and font-size
styles systemSlotStyles<InputWrapperSlots> | undefined—Uniform per-slot style passthrough — sugar over the composable parts. The `Input` host consumes the adornment slots (`root`/`leftSection`/`rightSection`); the field-chrome slots (`wrapper`/`label`/`description`/`error`/`required`) are consumed by `Input.Wrapper`. Forwarding the same map to both is safe — each applies only the slots it owns.
theme systemThemeName | null | undefined—Applies a theme to this element
variant systemInputVariant | undefined"default"Visual variant

Style slots

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

SlotTargets
descriptionThe Input.Description.
errorThe Input.Error.
labelThe Input.Label.
leftSectionThe left adornment section (InputSectionFrame). Applied by InputChrome. The deprecated leftSectionProps alias merges OVER this.
requiredThe required asterisk Text inside the label.
rightSectionThe right adornment section (InputSectionFrame). Applied by InputChrome. The deprecated rightSectionProps alias merges OVER this.
rootThe input frame/container (InputRootFrame) that InputChrome lays the control and its left/right sections out in. Applied by Input/InputChrome, not by Input.Wrapper. The deprecated wrapperProps alias merges OVER this.
wrapperThe outer InputWrapperFrame column.
Accessibility & DOM props (280)
PropType
aboutstring | undefined
acceptstring | undefined
accessKeystring | undefined
altstring | undefined
aria-activedescendantstring | undefined
aria-atomic(boolean | "true" | "false") | undefined
aria-autocomplete"list" | "none" | "inline" | "both" | undefined
aria-braillelabelstring | undefined
aria-brailleroledescriptionstring | undefined
aria-busy(boolean | "true" | "false") | undefined
aria-checkedboolean | "true" | "false" | "mixed" | undefined
aria-colcountnumber | undefined
aria-colindexnumber | undefined
aria-colindextextstring | undefined
aria-colspannumber | undefined
aria-controlsstring | undefined
aria-currentboolean | "step" | "true" | "false" | "time" | "page" | "location" | "date" | undefined
aria-describedbystring | undefined
aria-descriptionstring | undefined
aria-detailsstring | undefined
aria-disabled(boolean | "true" | "false") | undefined
aria-dropeffect"link" | "none" | "copy" | "move" | "execute" | "popup" | undefined
aria-errormessagestring | undefined
aria-expanded(boolean | "true" | "false") | undefined
aria-flowtostring | undefined
aria-grabbed(boolean | "true" | "false") | undefined
aria-haspopupboolean | "true" | "false" | "dialog" | "grid" | "menu" | "tree" | "listbox" | undefined
aria-hidden(boolean | "true" | "false") | undefined
aria-invalidboolean | "true" | "false" | "grammar" | "spelling" | undefined
aria-keyshortcutsstring | undefined
aria-labelstring | undefined
aria-labelledbystring | undefined
aria-levelnumber | undefined
aria-live"polite" | "assertive" | "off" | undefined
aria-modal(boolean | "true" | "false") | undefined
aria-multiline(boolean | "true" | "false") | undefined
aria-multiselectable(boolean | "true" | "false") | undefined
aria-orientation"horizontal" | "vertical" | undefined
aria-ownsstring | undefined
aria-placeholderstring | undefined
aria-posinsetnumber | undefined
aria-pressedboolean | "true" | "false" | "mixed" | undefined
aria-readonly(boolean | "true" | "false") | undefined
aria-relevant"text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined
aria-required(boolean | "true" | "false") | undefined
aria-roledescriptionstring | undefined
aria-rowcountnumber | undefined
aria-rowindexnumber | undefined
aria-rowindextextstring | undefined
aria-rowspannumber | undefined
aria-selected(boolean | "true" | "false") | undefined
aria-setsizenumber | undefined
aria-sort"none" | "ascending" | "descending" | "other" | undefined
aria-valuemaxnumber | undefined
aria-valueminnumber | undefined
aria-valuenownumber | undefined
aria-valuetextstring | undefined
autoSavestring | undefined
captureboolean | "user" | "environment" | undefined
checkedboolean | undefined
contentstring | undefined
contentEditable"inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined
contextMenustring | undefined
dangerouslySetInnerHTML{ __html: string | TrustedHTML; } | undefined
datatypestring | undefined
defaultCheckedboolean | undefined
dirstring | undefined
draggable(boolean | "true" | "false") | undefined
exportpartsstring | undefined
formstring | undefined
formActionstring | ((formData: FormData) => void | Promise<void>) | undefined
formEncTypestring | undefined
formMethodstring | undefined
formNoValidateboolean | undefined
formTargetstring | undefined
heightstring | number | undefined
hiddenboolean | undefined
inertboolean | undefined
inlistany
inputMode"text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined
isstring | undefined
itemIDstring | undefined
itemPropstring | undefined
itemRefstring | undefined
itemScopeboolean | undefined
itemTypestring | undefined
keyKey | null | undefined
langstring | undefined
liststring | undefined
noncestring | undefined
onAbortReactEventHandler<HTMLInputElement> | undefined
onAbortCaptureReactEventHandler<HTMLInputElement> | undefined
onAnimationEndAnimationEventHandler<HTMLInputElement> | undefined
onAnimationEndCaptureAnimationEventHandler<HTMLInputElement> | undefined
onAnimationIterationAnimationEventHandler<HTMLInputElement> | undefined
onAnimationIterationCaptureAnimationEventHandler<HTMLInputElement> | undefined
onAnimationStartAnimationEventHandler<HTMLInputElement> | undefined
onAnimationStartCaptureAnimationEventHandler<HTMLInputElement> | undefined
onAuxClickMouseEventHandler<HTMLInputElement> | undefined
onAuxClickCaptureMouseEventHandler<HTMLInputElement> | undefined
onBeforeInputInputEventHandler<HTMLInputElement> | undefined
onBeforeInputCaptureInputEventHandler<HTMLInputElement> | undefined
onBeforeToggleToggleEventHandler<HTMLInputElement> | undefined
onBlurFocusEventHandler<HTMLInputElement> | undefined
onBlurCaptureFocusEventHandler<HTMLInputElement> | undefined
onCanPlayReactEventHandler<HTMLInputElement> | undefined
onCanPlayCaptureReactEventHandler<HTMLInputElement> | undefined
onCanPlayThroughReactEventHandler<HTMLInputElement> | undefined
onCanPlayThroughCaptureReactEventHandler<HTMLInputElement> | undefined
onChangeCaptureChangeEventHandler<HTMLInputElement, Element> | undefined
onClickMouseEventHandler<HTMLInputElement> | undefined
onClickCaptureMouseEventHandler<HTMLInputElement> | undefined
onCompositionEndCompositionEventHandler<HTMLInputElement> | undefined
onCompositionEndCaptureCompositionEventHandler<HTMLInputElement> | undefined
onCompositionStartCompositionEventHandler<HTMLInputElement> | undefined
onCompositionStartCaptureCompositionEventHandler<HTMLInputElement> | undefined
onCompositionUpdateCompositionEventHandler<HTMLInputElement> | undefined
onCompositionUpdateCaptureCompositionEventHandler<HTMLInputElement> | undefined
onContextMenuMouseEventHandler<HTMLInputElement> | undefined
onContextMenuCaptureMouseEventHandler<HTMLInputElement> | undefined
onCopyClipboardEventHandler<HTMLInputElement> | undefined
onCopyCaptureClipboardEventHandler<HTMLInputElement> | undefined
onCutClipboardEventHandler<HTMLInputElement> | undefined
onCutCaptureClipboardEventHandler<HTMLInputElement> | undefined
onDoubleClickMouseEventHandler<HTMLInputElement> | undefined
onDoubleClickCaptureMouseEventHandler<HTMLInputElement> | undefined
onDragDragEventHandler<HTMLInputElement> | undefined
onDragCaptureDragEventHandler<HTMLInputElement> | undefined
onDragEndDragEventHandler<HTMLInputElement> | undefined
onDragEndCaptureDragEventHandler<HTMLInputElement> | undefined
onDragEnterDragEventHandler<HTMLInputElement> | undefined
onDragEnterCaptureDragEventHandler<HTMLInputElement> | undefined
onDragExitDragEventHandler<HTMLInputElement> | undefined
onDragExitCaptureDragEventHandler<HTMLInputElement> | undefined
onDragLeaveDragEventHandler<HTMLInputElement> | undefined
onDragLeaveCaptureDragEventHandler<HTMLInputElement> | undefined
onDragOverDragEventHandler<HTMLInputElement> | undefined
onDragOverCaptureDragEventHandler<HTMLInputElement> | undefined
onDragStartDragEventHandler<HTMLInputElement> | undefined
onDragStartCaptureDragEventHandler<HTMLInputElement> | undefined
onDropDragEventHandler<HTMLInputElement> | undefined
onDropCaptureDragEventHandler<HTMLInputElement> | undefined
onDurationChangeReactEventHandler<HTMLInputElement> | undefined
onDurationChangeCaptureReactEventHandler<HTMLInputElement> | undefined
onEmptiedReactEventHandler<HTMLInputElement> | undefined
onEmptiedCaptureReactEventHandler<HTMLInputElement> | undefined
onEncryptedReactEventHandler<HTMLInputElement> | undefined
onEncryptedCaptureReactEventHandler<HTMLInputElement> | undefined
onEndedReactEventHandler<HTMLInputElement> | undefined
onEndedCaptureReactEventHandler<HTMLInputElement> | undefined
onErrorReactEventHandler<HTMLInputElement> | undefined
onErrorCaptureReactEventHandler<HTMLInputElement> | undefined
onFocusFocusEventHandler<HTMLInputElement> | undefined
onFocusCaptureFocusEventHandler<HTMLInputElement> | undefined
onGotPointerCapturePointerEventHandler<HTMLInputElement> | undefined
onGotPointerCaptureCapturePointerEventHandler<HTMLInputElement> | undefined
onInputCaptureInputEventHandler<HTMLInputElement> | undefined
onInvalidReactEventHandler<HTMLInputElement> | undefined
onInvalidCaptureReactEventHandler<HTMLInputElement> | undefined
onKeyDownCaptureKeyboardEventHandler<HTMLInputElement> | undefined
onKeyPressKeyboardEventHandler<HTMLInputElement> | undefined
onKeyPressCaptureKeyboardEventHandler<HTMLInputElement> | undefined
onKeyUpKeyboardEventHandler<HTMLInputElement> | undefined
onKeyUpCaptureKeyboardEventHandler<HTMLInputElement> | undefined
onLoadReactEventHandler<HTMLInputElement> | undefined
onLoadCaptureReactEventHandler<HTMLInputElement> | undefined
onLoadedDataReactEventHandler<HTMLInputElement> | undefined
onLoadedDataCaptureReactEventHandler<HTMLInputElement> | undefined
onLoadedMetadataReactEventHandler<HTMLInputElement> | undefined
onLoadedMetadataCaptureReactEventHandler<HTMLInputElement> | undefined
onLoadStartReactEventHandler<HTMLInputElement> | undefined
onLoadStartCaptureReactEventHandler<HTMLInputElement> | undefined
onLostPointerCapturePointerEventHandler<HTMLInputElement> | undefined
onLostPointerCaptureCapturePointerEventHandler<HTMLInputElement> | undefined
onMouseDownMouseEventHandler<HTMLInputElement> | undefined
onMouseDownCaptureMouseEventHandler<HTMLInputElement> | undefined
onMouseEnterMouseEventHandler<HTMLInputElement> | undefined
onMouseLeaveMouseEventHandler<HTMLInputElement> | undefined
onMouseMoveMouseEventHandler<HTMLInputElement> | undefined
onMouseMoveCaptureMouseEventHandler<HTMLInputElement> | undefined
onMouseOutMouseEventHandler<HTMLInputElement> | undefined
onMouseOutCaptureMouseEventHandler<HTMLInputElement> | undefined
onMouseOverMouseEventHandler<HTMLInputElement> | undefined
onMouseOverCaptureMouseEventHandler<HTMLInputElement> | undefined
onMouseUpMouseEventHandler<HTMLInputElement> | undefined
onMouseUpCaptureMouseEventHandler<HTMLInputElement> | undefined
onPasteClipboardEventHandler<HTMLInputElement> | undefined
onPasteCaptureClipboardEventHandler<HTMLInputElement> | undefined
onPauseReactEventHandler<HTMLInputElement> | undefined
onPauseCaptureReactEventHandler<HTMLInputElement> | undefined
onPlayReactEventHandler<HTMLInputElement> | undefined
onPlayCaptureReactEventHandler<HTMLInputElement> | undefined
onPlayingReactEventHandler<HTMLInputElement> | undefined
onPlayingCaptureReactEventHandler<HTMLInputElement> | undefined
onPointerCancelPointerEventHandler<HTMLInputElement> | undefined
onPointerCancelCapturePointerEventHandler<HTMLInputElement> | undefined
onPointerDownPointerEventHandler<HTMLInputElement> | undefined
onPointerDownCapturePointerEventHandler<HTMLInputElement> | undefined
onPointerEnterPointerEventHandler<HTMLInputElement> | undefined
onPointerLeavePointerEventHandler<HTMLInputElement> | undefined
onPointerMovePointerEventHandler<HTMLInputElement> | undefined
onPointerMoveCapturePointerEventHandler<HTMLInputElement> | undefined
onPointerOutPointerEventHandler<HTMLInputElement> | undefined
onPointerOutCapturePointerEventHandler<HTMLInputElement> | undefined
onPointerOverPointerEventHandler<HTMLInputElement> | undefined
onPointerOverCapturePointerEventHandler<HTMLInputElement> | undefined
onPointerUpPointerEventHandler<HTMLInputElement> | undefined
onPointerUpCapturePointerEventHandler<HTMLInputElement> | undefined
onProgressReactEventHandler<HTMLInputElement> | undefined
onProgressCaptureReactEventHandler<HTMLInputElement> | undefined
onRateChangeReactEventHandler<HTMLInputElement> | undefined
onRateChangeCaptureReactEventHandler<HTMLInputElement> | undefined
onResetReactEventHandler<HTMLInputElement> | undefined
onResetCaptureReactEventHandler<HTMLInputElement> | undefined
onScrollUIEventHandler<HTMLInputElement> | undefined
onScrollCaptureUIEventHandler<HTMLInputElement> | undefined
onScrollEndUIEventHandler<HTMLInputElement> | undefined
onScrollEndCaptureUIEventHandler<HTMLInputElement> | undefined
onSeekedReactEventHandler<HTMLInputElement> | undefined
onSeekedCaptureReactEventHandler<HTMLInputElement> | undefined
onSeekingReactEventHandler<HTMLInputElement> | undefined
onSeekingCaptureReactEventHandler<HTMLInputElement> | undefined
onSelectReactEventHandler<HTMLInputElement> | undefined
onSelectCaptureReactEventHandler<HTMLInputElement> | undefined
onStalledReactEventHandler<HTMLInputElement> | undefined
onStalledCaptureReactEventHandler<HTMLInputElement> | undefined
onSubmitSubmitEventHandler<HTMLInputElement> | undefined
onSubmitCaptureSubmitEventHandler<HTMLInputElement> | undefined
onSuspendReactEventHandler<HTMLInputElement> | undefined
onSuspendCaptureReactEventHandler<HTMLInputElement> | undefined
onTimeUpdateReactEventHandler<HTMLInputElement> | undefined
onTimeUpdateCaptureReactEventHandler<HTMLInputElement> | undefined
onToggleToggleEventHandler<HTMLInputElement> | undefined
onTouchCancelTouchEventHandler<HTMLInputElement> | undefined
onTouchCancelCaptureTouchEventHandler<HTMLInputElement> | undefined
onTouchEndTouchEventHandler<HTMLInputElement> | undefined
onTouchEndCaptureTouchEventHandler<HTMLInputElement> | undefined
onTouchMoveTouchEventHandler<HTMLInputElement> | undefined
onTouchMoveCaptureTouchEventHandler<HTMLInputElement> | undefined
onTouchStartTouchEventHandler<HTMLInputElement> | undefined
onTouchStartCaptureTouchEventHandler<HTMLInputElement> | undefined
onTransitionCancelTransitionEventHandler<HTMLInputElement> | undefined
onTransitionCancelCaptureTransitionEventHandler<HTMLInputElement> | undefined
onTransitionEndTransitionEventHandler<HTMLInputElement> | undefined
onTransitionEndCaptureTransitionEventHandler<HTMLInputElement> | undefined
onTransitionRunTransitionEventHandler<HTMLInputElement> | undefined
onTransitionRunCaptureTransitionEventHandler<HTMLInputElement> | undefined
onTransitionStartTransitionEventHandler<HTMLInputElement> | undefined
onTransitionStartCaptureTransitionEventHandler<HTMLInputElement> | undefined
onVolumeChangeReactEventHandler<HTMLInputElement> | undefined
onVolumeChangeCaptureReactEventHandler<HTMLInputElement> | undefined
onWaitingReactEventHandler<HTMLInputElement> | undefined
onWaitingCaptureReactEventHandler<HTMLInputElement> | undefined
onWheelWheelEventHandler<HTMLInputElement> | undefined
onWheelCaptureWheelEventHandler<HTMLInputElement> | undefined
partstring | undefined
popover"" | "auto" | "manual" | "hint" | undefined
popoverTargetstring | undefined
popoverTargetAction"hide" | "show" | "toggle" | undefined
prefixstring | undefined
propertystring | undefined
radioGroupstring | undefined
refRef<TamaguiElement> | undefined
relstring | undefined
resourcestring | undefined
resultsnumber | undefined
revstring | undefined
roleAriaRole | undefined
securitystring | undefined
slotstring | undefined
srcstring | undefined
suppressContentEditableWarningboolean | undefined
suppressHydrationWarningboolean | undefined
tabIndexnumber | undefined
titlestring | undefined
translate"yes" | "no" | undefined
typeofstring | undefined
unselectable"off" | "on" | undefined
vocabstring | undefined
widthstring | number | undefined

Plus 511 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