Skip to content

Token field

Turns typed entries into tokens that you can edit and remove.

Tags
token-field-basic-demo.tsx

Installation

The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.

Composition

  • TokenField

    Owns the value and editing state.

    • TokenFieldLabel
    • TokenFieldInput
    • TokenFieldDescription

TagFieldValue Splits text into tags at each comma or line break. Pass an instance to the value prop.

Disabled

Tags
​Archived​​2025​
token-field-disabled-demo.tsx

Project tags

Commit the draft with onSubmit. Uncommitted text is not a token.

Project tags
​Design​​Review​
Type a tag, then press comma or Enter. Press Backspace to remove a tag.

2 tags added

token-field-demo.tsx

Sizes

​Design​​Research​
​Design​​Research​
​Design​​Research​
​Design​​Research​
token-field-sizes-demo.tsx

API reference

vip/ui adds or changes the props below. For all other props, see React Aria TokenField (opens in a new tab).

size: "xs" | "sm" | "md" | "lg" | "xl" = "lg"
Sets the size of the input box. Tokens keep one size.
label: string
Label above the field in the default layout. Without it, pass aria-label.
description: string
Help text below the field in the default layout.
placeholder: string
Input placeholder in the default layout.