Skip to content

A field where people type their own values (recipients, labels, skills) and each one becomes a removable chip.

import { BbTag } from 'bitboss-ui';

On this page

Use it for

Use BbTag when users invent the values, such as recipients, skills, or issue labels.

Use something else when

  • BbSelect in multiple mode, when values come from a known set
  • BbBadge, when tokens are only displayed

Also see: Validated forms.

Passthrough

Hover or tap a part to outline it. The toggles turn on loading, errors and warnings where the component has them; only parts get a row.

accessibilitydesign systemGuidance while the control is focused.

Invite recipients with feedback

Seed a string[] model and show feedback for values rejected by the cap or duplicate check.

[email protected][email protected][email protected]

3 of 5 invited, 1 as guest

duplicate and max report the refused string but render no message. Put application wording in warnings or a toast.

A function on pt:badge runs once per tag and receives { item, highlighted }, with item the tag string. One chip can then stand out by its value, as the guest addresses do here. Say it in text too: colour alone is not a signal.

Coming from v2

modelValue is now strictly string[]; object arrays no longer compile. The removed multiple prop was always true, so delete it. Duplicates matched exactly in v2 and now ignore case: 'Vue' then 'vue' fires duplicate. Add case-sensitive to keep the old matching.

Commit and normalize entries

divider chooses the commit key. Add comma only when commas cannot belong inside a valid token.

bugneeds-triageSeparate labels with a comma, or press Enter. A pasted list becomes one chip per label.

Entries are trimmed. Duplicate matching ignores case; use case-sensitive only when case changes identity.

Committing splits the text on every single-character divider, so with comma among them a pasted a, b, c becomes three chips on the next Enter. Each piece is trimmed and meets the duplicate and max checks on its own; pieces that do not fit under the cap stay in the field.

Edit tokens without a pointer

With an empty input, Backspace highlights then removes, arrows move between chips, Home/End jump, and Escape returns to typing.

TypeScriptVueNuxtLaravelEmpty field: Backspace highlights, Backspace again removes, arrows move, Escape returns to typing.

Keep instructions in a hint when the workflow depends on keyboard editing. The input retains DOM focus and announces the highlighted chip.

Validate and lock the field

A field joined to a BbForm by its name is validated through rules, which see the whole array. Write the requirement there, as rules="required" for at least one tag or a function for a larger minimum; the asterisk follows. The required prop on a joined field is a hint: it marks the field and checks nothing.

vantera.iovantera.devChecked against the registry when you edit them.
accessibilitydesign systemdocumentation

Outside a form, compute the message yourself and pass it through errors; there required marks the field. loading is only status and does not lock editing. Use readonly for a set people may copy, adding formless when the form should not own it. disabled removes the field from the tab order. Add clearable only when deleting the whole array is expected.

comma is a compact display mode with no per-chip remove buttons. For read-only tokens outside a field, render BbBadge instead.

Look and density

variant, label-mode and compact change how the field looks, never how it behaves; pick them to match the text fields around it.

VueNuxt
VueNuxt
VueNuxt
VueNuxt
VueNuxt
VueNuxt
VueNuxt
VueNuxt

variant="none" drops every colour, focus ring included, for a field you style yourself, like the flat search field on BbTextInput.

The slots match the text fields too: prepend and append sit inside the box, prepend:outer and append:outer beside it, for a button such as "Import list" that belongs to the field but not to the chips.