Skip to main content

Tags Input

The Tags Input component allows users to create, select, and delete tags from a dropdown list. It supports both predefined options and user-created custom tags.

Properties

Data

PropertyDescriptionExpected Value
LabelThe label text displayed for the field.String (e.g., Tags, Categories)
PlaceholderPlaceholder text shown when no tags are selected.String (e.g., Add or select a tag)

Tags

Property
DescriptionExpected Value
Dynamic tagsToggle to switch between static and dynamic options mode. When enabled, options are defined via a schema.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Default valuePre-selected tag values when component loads. Only visible when Dynamic tags is OFF.Comma-separated values or array
SchemaJSON array defining tag options. Only visible when Dynamic tags is ON.Array of objects with label, value, visible, default, and disable properties
Sort tagsSort order for tags in the dropdown.none, asc (A-Z), or desc (Z-A)
Allow new tagsWhen enabled, users can create new tags by typing values not in the predefined list.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Turn on searchWhen enabled, users can search/filter tags in the dropdown. When disabled, the dropdown menu does not appear and the component acts as a simple input field.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.

Dynamic Tags

When Dynamic tags is enabled, use this schema format:

{{[
{ label: 'Newport', value: 'newport', visible: true, default: false, disable: false },
{ label: 'New York', value: 'new_york', visible: true, default: false, disable: false },
{ label: 'San Clemente', value: 'san_clemente', visible: true, default: true, disable: false }
]}}
Schema PropertyDescription
labelDisplay text shown in the dropdown
valueInternal value stored when selected
visibleWhether the option is shown in the dropdown
defaultWhether the option is pre-selected
disableWhether the option is disabled (not selectable)

Component Specific Actions (CSA)

The following actions of the component can be controlled using the component-specific actions (CSA), you can trigger it using an event or use a RunJS query.

Actions
DescriptionHow To Access
Select TagsProgrammatically selects specified tags. Matches by value or label.components.tagsinput1.selectTags
Deselect TagsProgrammatically removes specified tags from selection. Matches by value or label.components.tagsinput1.deselectTags
ClearClears all selected tags.components.tagsinput1.clear
Set visibilityShows or hides the component.components.tagsinput1.setVisibility
Set loadingSets the loading state of the component.components.tagsinput1.setLoading
Set disableEnables or disables the component.components.tagsinput1.setDisable

Select Tags / Deselect Tags Input Formats

Both selectTags and deselectTags support multiple input formats:

Format
ExampleDescription
Array of values['newport', 'new_york']Matches tags by their value property
Array of labels['Newport', 'New York']Matches tags by their label property
Array of objects with value[{value: 'newport'}]Explicitly match by value
Array of objects with label[{label: 'Newport'}]Explicitly match by label
Mixed formats['newport', {label: 'New York'}]Combine different formats
Matching Priority

When a string is passed, the component first tries to match by value. If no match is found, it tries to match by label.

Example Usage

// Select by values
components.tagsInput1.selectTags(['newport', 'new_york'])

// Select by labels
components.tagsInput1.selectTags(['Newport', 'New York'])

// Select using objects
components.tagsInput1.selectTags([
{ value: 'newport' },
{ label: 'New York' }
])

// Deselect by label
components.tagsInput1.deselectTags(['Newport'])

// Deselect using mixed format
components.tagsInput1.deselectTags(['newport', { label: 'New York' }])

// Clear all selections
components.tagsInput1.clear()

// Hide the component
components.tagsInput1.setVisibility(false)

Exposed Variables

Access these variables to get the current state of the component:

VariableDescriptionHow To Access
valuesReturns the array of value of selected tags.components.tagsinput1.values
tagsReturns the array of all the available tags.components.tagsinput1.tags
newTagsAddedReturns the array of all the newly added tags.components.tagsinput1.newTagsAdded
selectedTagsReturns the array of label and values of all the selected tags.components.tagsinput1.selectedTags
LabelThe label text displayed for the field.components.tagsinput1.label

Example Usage

// Get all selected values
{{components.tagsInput1.values}}
// Returns: ['newport', 'new_york']

// Get selected tags with labels
{{components.tagsInput1.tags}}
// Returns: [{ label: 'Newport', value: 'newport' }, { label: 'New York', value: 'new_york' }]

// Get only user-created tags
{{components.tagsInput1.newTagsAdded}}
// Returns: ['custom_tag_1', 'custom_tag_2']

Events

EventDescription
On tag addedTriggered when a tag is selected or a new tag is created.
On tag deletedTriggered when a tag is removed from the selection.
On focusTriggered when the input field receives focus.
On blurTriggered when the input field loses focus.
info

Check Action Reference docs to get detailed information about all the Actions.

Validation

Property
Description
Make this field mandatoryWhen enabled, the form cannot be submitted without at least one tag selected.
Custom validationCustom validation rule using JavaScript expression.

Custom Validation Example

{{components.tagsInput1.values.length >= 2 && 'valid'}}

This validates that at least 2 tags are selected.

Additional Actions

Property
DescriptionConfiguration Options
Dynamic heightWhen enabled, the component height adjusts based on the number of selected tags.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Loading stateShows a loading overlay on the entire component.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
VisibilityControls whether the component is visible.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
DisableWhen enabled, the component becomes non-interactive.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
TooltipText displayed when hovering over the component.String

Devices

Property
Description
Expected Value
Show on desktopMakes the component visible in desktop view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Show on mobileMakes the component visible in mobile view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.

Styles

Label Styles

PropertyDescriptionConfiguration Options
ColorLabel text color.Select the color or click on fx and input code that programmatically returns a Hex color code.
AlignmentLabel position: Side (left of field) or Top (above field).Choose between Side or Top.
DirectionLabel alignment when using Side layout.Choose between Left or Right.
WidthWhen Alignment is Side and Auto is disabled, sets the label width percentage.Enter the value or use the slider.

Field Styles

PropertyDescriptionConfiguration Options
BackgroundBackground color of the input field.Select the color or click on fx and input code that programmatically returns a Hex color code.
BorderBorder color of the input field.Select the color or click on fx and input code that programmatically returns a Hex color code.
AccentColor used for focus state and highlights.Select the color or click on fx and input code that programmatically returns a Hex color code.
Auto pick chip colorWhen enabled, the component will automatically pick colors for the chips, otherwise, you can configure the color by disabling it.You can check the box to enable it or uncheck it to disable.
Chip colorBackground color of selected tag chips.Select the color or click on fx and input code that programmatically returns a Hex color code.
Text colorText color inside selected tags.Select the color or click on fx and input code that programmatically returns a Hex color code.
Error textColor for validation error messages.Select the color or click on fx and input code that programmatically returns a Hex color code.
Border radiusCorner radius of the input field.Enter the value in pixels.
Box ShadowShadow effect around the component.Select the box shadow color and adjust the related properties or set it programmatically using fx.

Container Styles

PropertyDescriptionDefault
PaddingPadding around the component: Default or None.Default