Description
react-tagsinput is a React component for entering tags in an input field, and the README describes it as highly customizable. It is controlled through a value array of tags and an onChange callback that fires when the tags change. Props let you choose the keys that add and remove tags, react as the user types through onChangeInput, and validate tags with a validation regex or a validate function, with onValidationReject called when a tag is refused. You can allow only unique tags with onlyUnique, cap the number of tags with maxTags, add a tag when the field loses focus with addOnBlur, and handle paste with addOnPaste and pasteSplit. Each part can be adjusted through tagProps and inputProps, or replaced with the renderTag, renderInput and renderLayout props. The component exposes methods to focus and blur the input, accept the current input, add a tag and clear the input. A basic stylesheet, react-tagsinput.css, is included for styling. The README has an example and a full component interface reference, and the project is on GitHub under olahol.…
Highlights
- Controlled tag list with value and onChange
- Custom keys to add and remove tags
- Validation by regex or function
- Unique tags, a maxTags limit and paste splitting
- renderTag, renderInput and renderLayout customization
Ratings & Reviews
No ratings yet
Be the first to rate react-tagsinput.
People also visit

react-tag-input
React tags is a fantastically simple tagging component for your React projects
react-tagsinput FAQ
What does react-tagsinput do?
It is a React component for entering tags, with customizable keys, validation and rendering.
Is it controlled?
Yes. You pass the tags in value and update them in onChange.
How do I validate tags?
With validationRegex or a validate function. onValidationReject is called when a tag is refused.
Can I limit the number of tags?
Yes. maxTags caps the count, and onlyUnique keeps duplicates out.
How do I style it?
Start with the included react-tagsinput.css, then customize with tagProps, inputProps or the render props.
Which methods can I call?
focus(), blur(), accept(), addTag() and clearInput().
What are the best react-tagsinput alternatives?
Popular alternatives to react-tagsinput include react-tag-input, react-number-format and react-typeahead. See all react-tagsinput alternatives
















