Tags Input

A chips-in-input control: type and press Enter or comma to create a tag, paste a delimited list to add several, and remove tags with the X or Backspace.

$bunx shadcn@latest add @nx-ui/tags-input
Registry item
Installs withtagutils

Cover-crop species

Create a tag on Enter or comma; Backspace at the start removes the last tag.

RyegrassWhite clover

Sizes

PeatLoam
PeatLoam
PeatLoam

Maximum tags

Once the maximum is reached, further input is ignored.

EWC 02 01 03EWC 20 02 01

Disabled & invalid

LockedRead-only
Invalid entry

The underlying tag

The removable Tag primitive, also used for filter chips and selected values.

DefaultVerifiedPendingMovements12RemovableOrganisation3

API reference

Exported parts and their props, extracted from the component source.

PropTypeDefaultDescription
sizekeyof typeof sizes"md"
placeholderstring
valuestring[]Controlled value: array of tag strings.
defaultValuestring[]Default tags for uncontrolled mode.
onValueChange(tags: string[]) => voidCalled whenever the committed tag array changes.
maxnumberMaximum number of tags; further input is ignored once reached.
allowDuplicatesbooleanfalseAllow duplicate tag values (default false).
disabledboolean
validate(value: string) => booleanReturn false to reject a candidate tag.
delimitersstring[][",", "Enter"]Keys/characters that commit the current text as a tag.

…extends Omit<React.ComponentProps<"div">, "onChange">