Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

TagsInput

Create and remove tags for an article.

Preview

Live preview

Changes apply to this preview only.

Publish an article

Add up to five topics. Enter or comma commits a tag; Backspace removes the last one.

  • design systems
  • accessibility
Press Enter to add a tag. Backspace removes the last tag. Maximum 5 tags.

2 of 5 topics selected.

2 topics

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Sizes

sm, md and lg follow the shared field scale.

Open preview

Delimiters and paste

Enter always commits. A custom delimiters list replaces the default comma. Pasting a list splits, trims and deduplicates it.

Open preview

Limits and duplicates

maxTags ignores extra values. Duplicates are rejected unless allowDuplicates is true.

Open preview

Usage

Normalize and validate tags according to the application's domain before persisting them.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluTagsInputProps

Type source
PimoluTagsInputProps public API
NameTypeDefaultDescription
valuestring[] | undefined—Controlled tags.
defaultValuestring[] | undefined—Initial tags when uncontrolled.
onValueChange((value: string[]) => void) | undefined—Called with the next tag list after adding or removing a tag.
maxTagsnumber | undefined—Maximum number of tags. Extra tags are ignored.
allowDuplicatesboolean | undefinedfalseAllow the same tag more than once. Defaults to false.
delimitersstring[] | undefined`[","]`; Enter always worksCharacters that commit the current draft, in addition to Enter. Defaults to `[","]`; Enter always works.
labelReactNode—Visible label, associated with the text input.
helperTextReactNode—Supporting text below the field.
errorboolean | undefinedfalseInvalid state without an error message.
errorMessageReactNode—Error text, replacing the helper text.
sizePimoluTagsInputSize | undefined"md"Visual size. Defaults to "md".
fullWidthboolean | undefinedfalseStretch to the parent width.
classNamestring | undefined—Class applied to the outer field.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLInputElement> | undefined—Standard React/HTML attribute.
disabledboolean | undefinedfalseStandard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
requiredboolean | undefinedfalseStandard React/HTML attribute.
value

string[] | undefined

No default extracted.

Controlled tags.

defaultValue

string[] | undefined

No default extracted.

Initial tags when uncontrolled.

onValueChange

((value: string[]) => void) | undefined

No default extracted.

Called with the next tag list after adding or removing a tag.

maxTags

number | undefined

No default extracted.

Maximum number of tags. Extra tags are ignored.

allowDuplicates

boolean | undefined

Default: false

Allow the same tag more than once. Defaults to false.

delimiters

string[] | undefined

Default: `[","]`; Enter always works

Characters that commit the current draft, in addition to Enter. Defaults to `[","]`; Enter always works.

label

ReactNode

No default extracted.

Visible label, associated with the text input.

helperText

ReactNode

No default extracted.

Supporting text below the field.

error

boolean | undefined

Default: false

Invalid state without an error message.

errorMessage

ReactNode

No default extracted.

Error text, replacing the helper text.

size

PimoluTagsInputSize | undefined

Default: "md"

Visual size. Defaults to "md".

fullWidth

boolean | undefined

Default: false

Stretch to the parent width.

className

string | undefined

No default extracted.

Class applied to the outer field.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

disabled

boolean | undefined

Default: false

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

required

boolean | undefined

Default: false

Standard React/HTML attribute.

Accessibility

  • Name the input and each removal action; check Enter and keyboard deletion.
Read the accessibility guide →