Skip to content

Tags Plugin

The tags plugin enhances the tagging experience by supporting comma-separated input and paste operations for creating multiple tags at once.

Usage

WARNING

The tags plugin requires data-create-items="true" and data-searchable="true" to function. Without these, the user cannot type new values.

Comma-Separated Input

When the tags plugin is active, typing a comma (or the configured separator) immediately creates a tag from the text before the separator:

Type: "react, vue, angular"
Result: Three tags — "react", "vue", "angular"

Leading and trailing whitespace around each tag is automatically trimmed.

Custom Separator

Change the separator character with data-tags-separator:

Paste Support

The tags plugin intercepts paste events and splits the pasted text by the separator character:

  • Pasting "react, vue, angular, svelte" creates four individual tags
  • Works with text copied from spreadsheets (each cell becomes a tag)
  • Duplicate values are automatically ignored

Combining with Other Plugins

A common combination is tags + remove-button:

Styling

Tags inherit the standard DotSelect item styling. Customize for a tag-like appearance:

css
.dot-select .ds-item {
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 9999px;
  padding: 1px 10px;
  font-size: 0.85rem;
}

MIT Licensed