Skip to main content

Tags Input

Rocket 2.0

The Tags Input component lets the user build a list of short tags by typing them or picking from suggestions, such as labels on a ticket, skills on a profile or email recipients. Each tag shows as a removable chip.

Properties​

Property
Description
Expected Value
LabelText shown above the field.Text. Default: Tags
Help textHint text shown under the field.Text
PlaceholderText shown in the field when it is empty.Text. Default: Add a tag...
Default tagsTags in the field when the app loads.Array
SuggestionsTags offered in a dropdown as the user types, as plain values or as items with a label and a value.Array
Allow tags not in suggestionsLets the user add tags that aren't in Suggestions. When off, only suggested tags can be added.On or off. Default: On
Max tags (0 for no limit)Most tags the field takes. Once reached, the user can't add more. 0 means no limit.Number. Default: 0
Case-sensitive duplicate checkTreats tags that differ only in uppercase and lowercase, such as Urgent and urgent, as different tags.On or off. Default: Off
Tag pattern (regex)A regular expression each new tag must match, such as ^[a-z0-9-]+$. Tags that don't match are refused with an error.Text
Pattern error messageMessage shown when a tag doesn't match Tag pattern (regex).Text
Add typed text on blurAdds the text still being typed as a tag when the field loses focus.On or off. Default: Off
Show clear buttonShows a button in the field that removes all the tags.On or off. Default: Off

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On changeTriggers when the user adds or removes a tag.
On tag addedTriggers when the user adds a tag.
On tag deletedTriggers when the user removes a tag.
On focusTriggers when the field gets focus.
On blurTriggers when the field loses focus.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set tagsReplaces all the tags with the given Tags.components.tagsinput1.setTags("")
Select tagsAdds the given Tags to the ones already in the field.components.tagsinput1.selectTags("")
Deselect tagsRemoves the given Tags from the field.components.tagsinput1.deselectTags("")
ClearRemoves all the tags and any text being typed.components.tagsinput1.clear()
Set focusMoves keyboard focus to the field.components.tagsinput1.setFocus()
Set blurRemoves focus from the field.components.tagsinput1.setBlur()
Set visibilityShows the component when true, hides it when false.components.tagsinput1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.tagsinput1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.tagsinput1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
labelText shown above the field.{{components.tagsinput1.label}}
descriptionHint text shown under the field.{{components.tagsinput1.description}}
placeholderText shown in the field when it is empty.{{components.tagsinput1.placeholder}}
defaultValueTags in the field when the app loads.{{components.tagsinput1.defaultValue}}
suggestionsTags offered in a dropdown as the user types, as plain values or as items with a label and a value.{{components.tagsinput1.suggestions}}
allowCustomTagsLets the user add tags that aren't in Suggestions. When off, only suggested tags can be added.{{components.tagsinput1.allowCustomTags}}
maxTagsMost tags the field takes. Once reached, the user can't add more. 0 means no limit.{{components.tagsinput1.maxTags}}
caseSensitiveTreats tags that differ only in uppercase and lowercase, such as Urgent and urgent, as different tags.{{components.tagsinput1.caseSensitive}}
tagPatternA regular expression each new tag must match, such as ^[a-z0-9-]+$. Tags that don't match are refused with an error.{{components.tagsinput1.tagPattern}}
patternErrorMessage shown when a tag doesn't match Tag pattern (regex).{{components.tagsinput1.patternError}}
addOnBlurAdds the text still being typed as a tag when the field loses focus.{{components.tagsinput1.addOnBlur}}
showClearBtnShows a button in the field that removes all the tags.{{components.tagsinput1.showClearBtn}}
valuesThe tags in the field.{{components.tagsinput1.values}}
newTagsAddedThe tags in the field that aren't in Suggestions.{{components.tagsinput1.newTagsAdded}}
lastAddedTagThe tag the user added last.{{components.tagsinput1.lastAddedTag}}
lastRemovedTagThe tag the user removed last.{{components.tagsinput1.lastRemovedTag}}
isVisibleWhether the component is visible.{{components.tagsinput1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.tagsinput1.isLoading}}
isDisabledWhether the component is disabled.{{components.tagsinput1.isDisabled}}

Styles​

Style
Default
Label colorTheme: Primary text
Help text colorTheme: Placeholder text
Field backgroundTheme: Surface 1
Field text colorTheme: Primary text
Placeholder colorTheme: Placeholder text
Field border colorTheme: Default border
Accent (focus ring, checks)Theme: Brand primary
Error color (message and border)Theme: Error
Field radius—
Chip backgroundTheme: Surface 3
Chip text colorTheme: Primary text
Menu backgroundTheme: Surface 1
Menu text colorTheme: Primary text
Highlighted option backgroundTheme: Surface 3
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.