Components/Inputs/TagsInput

TagsInput

Inputs

Freeform tag entry — type and press Enter to create tags.

Renders entered tags as Badge chips inside the input. Tags are committed on comma, space, or Enter. Supports max count, duplicate prevention, and paste-to-split.

Usage

import { TagsInput } from "nosible-ux"

export default function Example() {
  return (
    <TagsInput label="Watchlist tags" placeholder="Add tag..." />
  )
}

Examples

With max and no duplicates

earningsguidance

Up to 5 tags

Error state

Accessibility

The input has aria-invalid when error is present. Each tag's remove button has aria-label="Remove [tag]". Backspace on empty input removes the last tag.

Props

Name TypeDefaultDescription
allowDuplicates
boolean | undefinedfalseAllow the same tag more than once.
clearable
boolean | undefinedfalseWhen true, shows a clear-all button on the right.
defaultValue
string[] | undefinedUncontrolled initial tags.
description
string | undefinedHelper text below the input. Suppressed when `error` is present.
disabled
boolean | undefined
error
string | undefinedValidation error.
label
string | undefinedLabel rendered ALL-CAPS in Space Mono above the input.
maxTags
number | undefinedMaximum number of tags allowed.
onChange
((tags: string[]) => void) | undefinedCalled when the tag list changes.
placeholder
string | undefinedInput placeholder shown when there are no tags and nothing typed.
splitChars
string[] | undefined[",", " "]Characters that commit the current input as a tag.
value
string[] | undefinedControlled tag list.
variant
"default" | "filled" | "outline" | undefined"default"Visual variant.