Knit UI
GitHub

Playground

Loading playground…

false
false
false
Playground
<Input
  placeholder="Type here…"
  variant="default"
  size="sm"
  disabled={false}
  loading={false}
  pointer={false}
/>

Examples

Variants

The three chrome variants.

Loading example…

VariantsSourceStorybook

Sizes

The seven token sizes from xxs to xxl.

Loading example…

SizesSourceStorybook

Shadows

The inherited shadow elevation prop, from xs to xl.

Loading example…

ShadowsSourceStorybook

With Sections

Left and right sections hold icons, prefixes or actions.

Loading example…

With SectionsSourceStorybook

Loading

Loading indicator, positioned left or right.

Loading example…

LoadingSourceStorybook

Disabled

Disabled state.

Loading example…

DisabledSourceStorybook

Read Only

Read-only — the value is visible and focusable but cannot be edited.

Loading example…

Read OnlySourceStorybook

Error

Error state — toggles the error border and aria-invalid.

Loading example…

ErrorSourceStorybook

Multiline

Multiline renders a textarea host.

Loading example…

MultilineSourceStorybook

With Wrapper

Input.Wrapper ties together a label, description and error message with the correct accessibility wiring, then renders the input as its child.

Loading example…

With WrapperSourceStorybook

Styles

Per-slot styles targets individual parts — here the root frame and leftSection.

Loading example…

StylesSourceStorybook

Controlled

Controlled input demonstrating onChangeText.

Loading example…

ControlledSourceStorybook

Props

PropTypeDefaultDescription
autoCapitalize"none" | (string & {}) | "off" | "on" | "sentences" | "words" | "characters" | undefined
autoCompletestring | undefined
autoCorrectstring | boolean | undefined
autoFocusboolean | undefined
autosizeboolean | undefinedfalseGrows with content on web (scrollHeight-based); tracks onContentSizeChange on native.
childrenReactNodeRendered inside the host element. Only meaningful for the `button` host (e.g. FileInput's trigger displays the picked file name); ignored for the native `input`/`textarea`/`select` hosts.
componentInputHostTag | undefinedOverride the host element tag (defaults to `input`/`textarea`).
cursorColor"unset" | ColorTokens | undefined
defaultValuestring | number | readonly string[] | undefined
disabled systemboolean | undefinedfalse
enterKeyHint"search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined
errorReactNodeError message / flag — toggles error styling.
idstring | undefined
inputSizestring | undefinedHost size attribute for the input element
leftSectionReactNodeContent section displayed on the left side of the input
leftSectionPointerEventsInputSectionPointerEvents | undefined"none"Sets pointer-events styles on the left section element
leftSectionPropsPartial<GetFinalProps<RNTamaguiViewNonStyleProps, StackStyleBase, { shadow?: "xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined; sectionPointerEvents?: "none" | "all" | undefined; }>> | undefinedProps passed down to the left section element
leftSectionWidthnumber | Animated.AnimatedNode | GetThemeValueForKey<"width"> | null | undefinedLeft section width, by default equals to the input height
loadingboolean | undefinedfalseDisplays loading indicator in the left or right section
loadingPosition"left" | "right" | undefined
left · right
"right"Position of the loading indicator
maxstring | number | undefined
maxLengthnumber | undefined
maxRowsnumber | undefinedMaximum number of rows before scrolling (web). Caps height on native when autosize is on.
minstring | number | undefined
minLengthnumber | undefined
minRowsnumber | undefinedMinimum number of rows. Sets initial/minimum height on web; maps to numberOfLines on native.
multilineboolean | undefinedAdjusts padding and sizing calculations for multiline inputs
multipleboolean | undefined
namestring | undefined
onChangeChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined
onChangeText((text: string) => void) | undefinedFires on every change with just the string value.
onInputInputEventHandler<HTMLInputElement> | undefined
onKeyDownKeyboardEventHandler<HTMLInputElement> | undefined
onSelectionChange((event: InputSelectionChangePayload) => void) | undefinedFires when the text selection changes.
onSubmitEditing((event: InputTextEventPayload) => void) | undefinedFires when Enter/Return is pressed.
patternstring | undefined
placeholderstring | undefinedType here…
placeholderTextColor"unset" | ColorTokens | undefined
pointerboolean | undefinedfalseUse a pointer cursor (e.g. select-like inputs).
radius systemstring | number | undefinedTheme radius token (e.g. `$sm`) or any CSS value.
readOnlyboolean | undefined
requiredboolean | undefined
rightSectionReactNodeContent section displayed on the right side of the input
rightSectionPointerEventsInputSectionPointerEvents | undefined"none"Sets pointer-events styles on the right section element
rightSectionPropsPartial<GetFinalProps<RNTamaguiViewNonStyleProps, StackStyleBase, { shadow?: "xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined; sectionPointerEvents?: "none" | "all" | undefined; }>> | undefinedProps passed down to the right section element
rightSectionWidthnumber | Animated.AnimatedNode | GetThemeValueForKey<"width"> | null | undefinedRight section width, by default equals to the input height
rootRefRef<TamaguiElement> | undefinedRoot element ref
rowsnumber | undefinedRows for textarea (when render="textarea")
selection{ start: number; end?: number; } | undefinedSelection range
selectionColor"unset" | ColorTokens | undefined
selectionHandleColor"unset" | ColorTokens | undefined
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size systemInputSize | undefined
xxs · xs · sm · md · lg · xl · xxl
"sm"Controls height, horizontal padding and font size.
spellCheckboolean | undefinedControls spell checking.
stepstring | number | undefined
styles systemSlotStyles<InputWrapperSlots> | undefinedUniform 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.
textContentTypeInputTextContentType | undefinedText content type for iOS autofill. Use `autoComplete` where available.
theme systemThemeName | null | undefined
unset · blue · red · green · pink
Applies a theme to this element
typestring | undefined
underlineColorAndroid"unset" | ColorTokens | undefined
unstyledboolean | undefinedRemoves the host chrome so the input renders bare (used by composite inputs).
valuestring | number | readonly string[] | undefined
variant systemInputVariant | undefined
default · filled · unstyled
"default"Visual variant of the input chrome.
withAriaboolean | undefinedtrueDetermines whether accessibility attributes should be added
wrapperPropsPartial<GetFinalProps<RNTamaguiViewNonStyleProps, StackStyleBase, { radius?: string | number | undefined; size?: string | number | undefined; shadow?: "xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined; disabled?: boolean | undefi…

Style slots

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

SlotUsage
descriptionstyles={{ description: { … } }}
errorstyles={{ error: { … } }}
labelstyles={{ label: { … } }}
leftSectionstyles={{ leftSection: { … } }}
requiredstyles={{ required: { … } }}
rightSectionstyles={{ rightSection: { … } }}
rootstyles={{ root: { … } }}
wrapperstyles={{ wrapper: { … } }}
Accessibility & DOM props (280)
PropType
aboutstring | undefined
acceptstring | undefined
accessKeystring | undefined
altstring | undefined
aria-activedescendantstring | undefined
aria-atomic(boolean | "true" | "false") | undefined
aria-autocomplete"none" | "inline" | "list" | "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 | "time" | "true" | "false" | "page" | "step" | "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 | "dialog" | "menu" | "true" | "false" | "grid" | "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"all" | "text" | "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"search" | "none" | "text" | "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 457 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.