Skip to content
Forms

Tags Input

Type and commit free-form tags as removable chips.

Import

tsx
import { TagsInput } from "@cronus-ui/ui";
bash
npx cronus-ui add tags-input

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component TagsInputDefault layout:inline style:tags-input {
  aria-label:"Tags"
  label "Add a tag"
  text "Add a tag"
  text "Design"
  text "System"
}

page "/audit/tags-input/default" type:custom {
  use TagsInputDefault
}

API Reference

Generated from the component's exported types.

TagsInputProps

Skip TagsInputProps props table
PropTypeDefaultDescription
value
string[]—Controlled list of committed tags. Pair with `onValueChange`.
defaultValue
string[]—Initial tags for uncontrolled usage.
onValueChange
(tags: string[]) => void—Called with the next list of tags whenever a tag is added or removed.
placeholder
string—Placeholder shown in the text field when it is empty.
max
number—Maximum number of tags. Once reached, further additions are ignored.
disabled
booleanfalseDisables typing and tag removal.
allowDuplicates
booleanfalseWhen true, the same tag may be added more than once. Defaults to false.
delimiter
string | string[]DEFAULT_DELIMITERSCharacters that commit the current input as a tag, in addition to Enter. Defaults to a comma, so both Enter and "," commit.
validate
(tag: string) => boolean—Reject a tag when this returns false. Receives the trimmed candidate.
aria-invalid
boolean | "true" | "false"—Marks the field as invalid, applying error styling.
id
string—Native id for the text input (for an external `<label htmlFor>`).
aria-label
string—Accessible name for the text input when there is no visible label.
aria-labelledby
string—id of an element that labels the text input.
name
string—Native name for the text input.
className
string—Extra classes for the field wrapper.
inputClassName
string—Extra classes for the inner text input.