Component

TagsInput

Collects multiple values as removable Tag chips with keyboard and paste entry.

Install

Run the CLI to copy the source into your project.

pnpm dlx @stalk-ui/cli add @stalk-ui/tags-input

Examples

Live previews render through the docs app's PandaCSS codegen.

Theme
<TagsInput aria-label="Tags" defaultValue={['design', 'engineering']} placeholder="Add a tag…" />
Theme
<TagsInput aria-label="Tags" defaultValue={['one', 'two']} max={5} tone="success" />

Props

Public component props extracted from the source TypeScript types.

PropTypeRequiredDefaultDescription
`'aria-label'``string`No-Accessible name for the entry field.
`'aria-labelledby'``string`No-Id of an element labelling the entry field.
`'aria-describedby'``string`No-Id of an element describing the entry field.
`addOnBlur``boolean`No-Add the pending entry when the field loses focus.
`allowDuplicates``boolean`No-Allow the same value more than once. Defaults to false.
`className``string`No--
`defaultValue``string[]`No--
`formatTag``(value: string) => string`No-Format/normalize each entry before it becomes a tag (e.g. trim + lowercase an<br />email). Return an empty string to reject the entry. Applied per tag.
`getTagProps``(value: string, index: number) => TagStyleProps`No-Per-tag visual overrides — return a \`tone\`/\`variant\`/\`radius\` for each tag so<br />chips can differ in color and style (e.g. color a label by category).
`disabled``boolean`No--
`id``string`No--
`invalid``boolean`No--
`max``number`No-Maximum number of tags. Further entries are ignored.
`name``string`No-Submitted with a surrounding form: emits a hidden input per tag.
`onValueChange``(tags: string[]) => void`No--
`placeholder``string`No--
`removeLabel``string`No-Accessible label for each tag's remove button.
`size``TagsInputSize`No--
`tone``TagTone`No-Color palette for the chips. Defaults to \`accent\`.
`value``string[]`No--

Variants

Variant axes exposed by the underlying PandaCSS recipe or slot recipe.

VariantValues
`disabled``true`
`invalid``true`
`size``sm`, `md`, `lg`

Registry

Files this component contributes to your registry install.

  • Manifest: `/r/tags-input.json`
  • Recipe: `tagsInput`
  • Files: `src/components/ui/tags-input.tsx`