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> | undefined—Props 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> | undefined—Props forwarded to the underlying `Combobox`.
dataComboboxData | undefined—Suggestion options shown in the dropdown.
defaultDropdownOpenedboolean | undefined—Uncontrolled initial dropdown opened state.
defaultSearchValuestring | undefined—Uncontrolled initial search value.
defaultValuestring[] | undefined—Uncontrolled 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 | undefined—Controlled 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 | undefined—Associated `<form>` id for the hidden input.
hiddenInputNamestring | undefined—Hidden web-form input name (renders a comma-joined hidden field).
hiddenInputValuesDividerstring | undefined','Divider for the hidden input value.
idstring | undefined—Same as the web id property for setting a uid on an element
inputContainer((children: ReactNode) => ReactNode) | undefined——
inputSizestring | undefined—Host size attribute for the input element
inputWrapperOrderInputWrapperOrderItem[] | undefined——
isDuplicate((value: string, current: string[]) => boolean) | undefined—Custom duplicate check. Defaults to a case-insensitive match.
labelReactNode——
labelElement"div" | "label" | undefined——
labelPropsInputLabelProps | undefined——
leftSectionReactNode—Content 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; }>> | undefined—Props passed down to the left section element
leftSectionWidthnumber | Animated.AnimatedNode | GetThemeValueForKey<"width"> | null | undefined—Left section width, by default equals to the input height
limitnumber | undefinedInfinityMaximum number of suggestions displayed.
loadingboolean | undefined—Displays 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.
nothingFoundMessageReactNode—Message shown when no suggestion matches.
onBlurFocusEventHandler<HTMLInputElement> | undefined—Field blur handler.
onChange((value: string[]) => void) | undefined—Called when the tags change.
onClear(() => void) | undefined—Called when the clear button is pressed.
onDropdownClose(() => void) | undefined—Called when the dropdown closes.
onDropdownOpen(() => void) | undefined—Called when the dropdown opens.
onDuplicate((value: string) => void) | undefined—Called when the user tries to add a duplicate tag.
onFocusFocusEventHandler<HTMLInputElement> | undefined—Field focus handler.
onKeyDownKeyboardEventHandler<HTMLInputElement> | undefined—Field keydown handler (fires after the built-in behaviour).
onMaxTags((value: string) => void) | undefined—Called when the user tries to add more than `maxTags`.
onOptionSubmit((value: string) => void) | undefined—Called when a suggestion option is submitted.
onPasteClipboardEventHandler<HTMLInputElement> | undefined—Field paste handler (fires before the built-in split-on-paste behaviour).
onRemove((value: string) => void) | undefined—Called with the value of a removed tag.
onSearchChange((value: string) => void) | undefined—Called when the search value changes.
placeholderstring | undefinedAdd tag…Placeholder for the inner field.
pointerboolean | undefined—Determines whether the input should have cursor: pointer style
radius systemstring | number | undefined—Key of theme radius or a valid CSS value to set border-radius
readOnlyboolean | undefinedfalseRead-only mode (dropdown opens but tags can't change).
renderOptionComboboxRenderOption | undefined—Custom suggestion content. Receives `{ option, checked }`.
renderPillComboboxRenderPill | undefined—Custom pill content. Receives `{ option, value, onRemove, disabled }`; replaces the built-in `Pill`.
requiredboolean | undefined——
rightSectionReactNode—Content 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; }>> | undefined—Props passed down to the right section element
rightSectionWidthnumber | Animated.AnimatedNode | GetThemeValueForKey<"width"> | null | undefined—Right section width, by default equals to the input height
searchValuestring | undefined—Controlled 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> | undefined—Per-slot style sugar — props spread onto the matching part.
theme systemThemeName | null | undefined—Applies a theme to this element
valuestring[] | undefined—Controlled 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.

SlotTargets
clearButtonProps for the clear button (TagsInput.ClearButton).
dropdownProps for the floating surface (TagsInput.Dropdown).
emptyProps for the empty state (TagsInput.Empty).
groupProps for an option group (TagsInput.Group).
optionProps for each option row (TagsInput.Option).
optionsProps for the listbox body (TagsInput.Options).
pillProps for each tag chip (TagsInput.Pill → Pill).
pillsProps for the pill row wrapper (TagsInput.Pills → Pill.Group).
rootProps for the state-machine root (TagsInput.Root → <Combobox>).
triggerProps for the field trigger (TagsInput.Trigger → PillsInput).
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.

Edit this page on GitHub