Inputs
TagsInput
The TagsInput turns free text into a list of short values: the user types a tag, confirms it with Enter (or with a separator of your own), and it becomes a removable chip in front of the input. It binds to a collection of strings, offers known values through the browser's own suggestion list - or accepts nothing else - splits a pasted list into a tag each, and keeps the entries in shape on the way in: trimming, transforming, capping their length and their number, and rejecting the ones that repeat, that are too short, that fail a pattern or that a validator turns down, each rejection reported with the rule that caused it. The chips form a proper accessible list: one stop of the tab order that the arrow keys walk through, removable with Delete, correctable in place, movable by drag, by two taps on the handle a chip grows or with Alt and the arrows, with the ones a predicate pins in place carrying no dismiss button at all, and with every change announced to screen readers. It comes in three sizes, three variants and the whole accent palette, folds a long list away behind a chip, carries a label, a helper text, a prefix, a suffix, a counter, a clear button and a spinner for the suggestions it is still fetching, can be driven entirely from code, and takes part in an EditForm like any other input.
Overview
Adding and removing tags, the label and description, the field and tag variants, and separators that split typing and pasting.
Basic
Label & description
aria-describedby, so it is announced along with the field rather than only drawn - which
is where the rules of the field belong. LabelTemplate and DescriptionTemplate take markup
instead of a string.
Variants
Separators & pasting
", ". The same
separators split a paste, so a comma separated list arrives as a whole row of tags, each piece going
through the same validation. A paste spread over several lines is joined over the first separator on
its way in, so a column copied out of a spreadsheet does not land as one run-on tag.
Topics
Everything else about TagsInput, one page per topic.
- Suggestions & rulesSuggestions and restricting the tags to them, the count and length limits with the counter, and transforming, matching, validating and de-duplicating tags.
- Managing tagsCorrecting tags in place, reordering them by drag, tap or keyboard, folding the extra tags away, the clear button, and tags that cannot be removed.
- Keyboard, accessibility & templatesKeyboard navigation and typing, the live announcements and their localization, prefix and suffix texts, and tag templates with accessible names and per-tag styles.
- Forms, events & APIBinding the list of tags with form validation, the events that can cancel or correct a change, and driving the field from code.
- CustomizationDefaults through BitParams, the color, external icons, sizes, Style & Class with the CSS variables, and right-to-left fields.
- API referenceEvery parameter, public member, sub-class, enum and CSS variable of BitTagsInput.
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.