Knit UI
GitHub

Playground

Loading playground…

false
false
false
false
Playground
<TagsInput
  placeholder="Add tag…"
  size="sm"
  disabled={false}
  readOnly={false}
  clearable={false}
/>

Examples

Sizes

All seven sizes rendered side by side so metrics can be compared at a glance.

Loading example…

SizesSourceStorybook

Shadows

The shadow elevation prop, inherited from Box, across all token levels.

Loading example…

ShadowsSourceStorybook

Disabled

Disabled state — the field and remove buttons are inert.

Loading example…

DisabledSourceStorybook

Read Only

Read-only state — the dropdown opens but tags cannot be added or removed.

Loading example…

Read OnlySourceStorybook

With Field Chrome

With label, description, and inline error message to verify field chrome.

Loading example…

With Field ChromeSourceStorybook

With Suggestions

Suggestions dropdown — type to filter; pick an option to add it as a tag.

Loading example…

With SuggestionsSourceStorybook

Clearable

Clearable — shows an × button when at least one tag is present.

Loading example…

ClearableSourceStorybook

Max Tags

Maximum tags — adding more than maxTags is silently ignored.

Loading example…

Max TagsSourceStorybook

Controlled

Controlled — the parent owns the tag list and wires onChange.

Loading example…

ControlledSourceStorybook

Styles

Per-slot styles targets individual parts — here the pill and trigger.

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
acceptValueOnBlurboolean | undefinedtrueCommit the pending typed value on blur.
allowDuplicatesboolean | undefinedfalseAllow duplicate tags.
clearableboolean | undefinedfalseShow a clear button when there is a value.
clearButtonPropsPartial<ComboboxClearButtonProps> | undefinedProps forwarded to the internal clear `Combobox.ClearButton`.
clearSearchOnChangeboolean | undefinedtrueClear the search field after a tag is added.
clearSectionMode"default" | "clear" | "rightSection" | "both" | undefined'both'How the clear button and right section coexist.
comboboxPropsPartial<ComboboxProps> | undefinedProps forwarded to the underlying `Combobox`.
dataComboboxData | undefinedSuggestion options shown in the dropdown.
defaultDropdownOpenedboolean | undefinedUncontrolled initial dropdown opened state.
defaultSearchValuestring | undefinedUncontrolled initial search value.
defaultValuestring[] | undefinedUncontrolled initial tags.
descriptionReactNode
descriptionPropsGetFinalProps<RNTamaguiTextNonStyleProps, TextStylePropsBase, { span?: boolean | undefined; size?: string | number | undefined; inherit?: boolean | undefined; lineClamp?: number | undefined; truncate?: boolean | "end" | "start" | undefined;…
disabled systemboolean | undefinedfalse
dropdownOpenedboolean | undefinedControlled dropdown opened state.
errorReactNode
errorPropsGetFinalProps<RNTamaguiTextNonStyleProps, TextStylePropsBase, { span?: boolean | undefined; size?: string | number | undefined; inherit?: boolean | undefined; lineClamp?: number | undefined; truncate?: boolean | "end" | "start" | undefined;…
filterOptionsFilter | undefineda case-insensitive label substring match.Custom options filter for the suggestions.
formstring | undefinedAssociated `<form>` id for the hidden input.
hiddenInputNamestring | undefinedHidden web-form input name (renders a comma-joined hidden field).
hiddenInputValuesDividerstring | undefined','Divider for the hidden input value.
idstring | undefinedSame as the web id property for setting a uid on an element
inputContainer((children: ReactNode) => ReactNode) | undefined
inputSizestring | undefinedHost size attribute for the input element
inputWrapperOrderInputWrapperOrderItem[] | undefined
isDuplicate((value: string, current: string[]) => boolean) | undefinedCustom duplicate check. Defaults to a case-insensitive match.
labelReactNode
labelElement"div" | "label" | undefined
labelPropsInputLabelProps | undefined
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
limitnumber | undefinedInfinityMaximum number of suggestions displayed.
loadingboolean | undefinedDisplays loading indicator in the left or right section
loadingPosition"left" | "right" | undefined"right"Position of the loading indicator
maxDropdownHeightnumber | undefined250Max dropdown height in px before scrolling.
maxTagsnumber | undefinedInfinityMaximum number of tags.
nothingFoundMessageReactNodeMessage shown when no suggestion matches.
onBlurFocusEventHandler<HTMLInputElement> | undefinedField blur handler.
onChange((value: string[]) => void) | undefinedCalled when the tags change.
onClear(() => void) | undefinedCalled when the clear button is pressed.
onDropdownClose(() => void) | undefinedCalled when the dropdown closes.
onDropdownOpen(() => void) | undefinedCalled when the dropdown opens.
onDuplicate((value: string) => void) | undefinedCalled when the user tries to add a duplicate tag.
onFocusFocusEventHandler<HTMLInputElement> | undefinedField focus handler.
onKeyDownKeyboardEventHandler<HTMLInputElement> | undefinedField keydown handler (fires after the built-in behaviour).
onMaxTags((value: string) => void) | undefinedCalled when the user tries to add more than `maxTags`.
onOptionSubmit((value: string) => void) | undefinedCalled when a suggestion option is submitted.
onPasteClipboardEventHandler<HTMLInputElement> | undefinedField paste handler (fires before the built-in split-on-paste behaviour).
onRemove((value: string) => void) | undefinedCalled with the value of a removed tag.
onSearchChange((value: string) => void) | undefinedCalled when the search value changes.
placeholderstring | undefinedAdd tag…Placeholder for the inner field.
pointerboolean | undefinedDetermines whether the input should have cursor: pointer style
radius systemstring | number | undefinedKey of theme radius or a valid CSS value to set border-radius
readOnlyboolean | undefinedfalseRead-only mode (dropdown opens but tags can't change).
renderOptionComboboxRenderOption | undefinedCustom suggestion content. Receives `{ option, checked }`.
renderPillComboboxRenderPill | undefinedCustom pill content. Receives `{ option, value, onRemove, disabled }`; replaces the built-in `Pill`.
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
searchValuestring | undefinedControlled search value.
selectFirstOptionOnChangeboolean | undefinedfalseHighlight the first matching suggestion after each search change.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
xxs · xs · sm · md · lg · xl · xxl
'md'Controls height, padding, and font size of the input and pills.
splitCharsstring[] | undefined[',']Characters that trigger a tag split.
styles systemSlotStyles<TagsInputStyles> | undefinedPer-slot style sugar — props spread onto the matching part.
theme systemThemeName | null | undefinedApplies a theme to this element
valuestring[] | undefinedControlled tags.
variant systemInputVariant | undefined"default"Visual variant
withAsteriskboolean | undefined
withScrollAreaboolean | undefinedtrueWrap suggestions in a `ScrollArea.Autosize`.
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 TagsInput can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
clearButtonstyles={{ clearButton: { … } }}
dropdownstyles={{ dropdown: { … } }}
emptystyles={{ empty: { … } }}
groupstyles={{ group: { … } }}
optionstyles={{ option: { … } }}
optionsstyles={{ options: { … } }}
pillstyles={{ pill: { … } }}
pillsstyles={{ pills: { … } }}
rootstyles={{ root: { … } }}
triggerstyles={{ trigger: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<(HTMLElement & TamaguiElementMethods) | View> | undefined

Plus 491 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.