TagInput

Molecule

Free-text input that creates chips. Add tags with Enter or comma, double-click to edit, Backspace to delete. Duplicates are ignored.

With initial tags

Preview
design frontend accessibility

Double-click a tag to edit it

Code
<%- include('modules/ui/TagInput', {
  label: 'Tags',
  value: ['design', 'frontend', 'accessibility']
}) %>

Empty with hint

Preview

Press Enter or comma to add a keyword.

Code
<%- include('modules/ui/TagInput', {
  label: 'Keywords',
  hint: 'Press Enter or comma to add a keyword.'
}) %>

Error state

Preview
only-one
Code
<%- include('modules/ui/TagInput', {
  label: 'Tags',
  value: ['only-one'],
  error: 'Please add at least 3 tags.'
}) %>

Disabled

Preview
react typescript

Double-click a tag to edit it

Code
<%- include('modules/ui/TagInput', {
  label: 'Locked tags',
  value: ['react', 'typescript'],
  disabled: true
}) %>
Source modules/ui/TagInput.ejs