pro-ui

TagInput

Multi-value tag input for comma-separated or enter-separated tag entry.

Import

import { TagInput } from '@dangbt/pro-ui'

Basic usage

<TagInput label="Tags" placeholder="Add tags..." />

Controlled

const [tags, setTags] = useState(['react', 'typescript'])
 
<TagInput
  label="Technologies"
  value={tags}
  onChange={setTags}
  placeholder="Add technology..."
/>

Props

PropTypeDefaultDescription
labelstringLabel
valuestring[]Controlled tags
defaultValuestring[]Uncontrolled default
onChange(tags: string[]) => voidCalled on change
placeholderstringPlaceholder
maxTagsnumberMaximum number of tags

On this page