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.
OptionsList of tags shown when Dynamic tags is OFF. Click a tag to edit its Option label, Option value, Make this default option, Visibility and Disable settings. Click Add new option to add a tag, and drag tags to reorder them. Reordering resets Sort tags to None.Configure each tag from the list.
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 the predefined tags in the dropdown.None, a-z or z-a
Allow new tagsWhen enabled, users can create new tags by typing values not in the predefined list. Enabled by default.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Tags loading stateWhen enabled, shows a loading indicator in the menu while options are being loaded. Only visible when Dynamic tags is ON.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.
Search typeSets whether the tag list is filtered in the browser (Client side) or by a query (Server side). Only visible when Turn on search is enabled.Client side or Server side, or click on fx and enter an expression that resolves to a boolean ({{true}} for Server side).

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)

Turn on Turn on search in the Tags section to let users search the tag list, then use Search type to choose where the filtering happens. When search is turned off, the dropdown menu does not appear and the component acts as a simple input field.

This is the default search option. The component filters the tags it already holds, in the browser. The complete tag list has to be loaded into the component for this to work.

When Search type is Server side, the component stops filtering the tags it holds in the browser, so the menu shows every tag it receives while the user types.

warning

Tags Input doesn't expose the text the user types or fire an event while they type, so a query can't react to the search text. Server side mode only turns off the in-browser filtering.

Sort tags still applies in Server side mode and re-sorts whatever the query returned, in the browser. Set it to none if your query already sorts the results.

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 user clicks inside the field.
On blurTriggered when the user clicks outside the component while its dropdown is open.
info

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

Component Specific Actions (CSA)​

The following actions of the component can be controlled using the component-specific actions (CSA):

Action
Description
How 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

Each string is matched against both the value and the label of every tag. The first tag in the list that matches either is selected. These actions don't trigger the On tag added or On tag deleted events.

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​

Variable
Description
How To Access
valuesReturns the array of values of selected tags.components.tagsinput1.values
tagsReturns an array of {label, value} objects for all visible predefined tags. Excludes tags created by the user.components.tagsinput1.tags
newTagsAddedReturns an array of {label, value} objects for the tags created by the user.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
isVisibleReturns the visibility state of the component.components.tagsinput1.isVisible
isLoadingReturns the loading state of the component.components.tagsinput1.isLoading
isDisabledReturns the disabled state of the component.components.tagsinput1.isDisabled
isMandatoryReturns whether the field is mandatory.components.tagsinput1.isMandatory
isValidReturns whether the current selection passes validation.components.tagsinput1.isValid

Example Usage​

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

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

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

// Check if component is valid
{{components.tagsinput1.isValid}}
// Returns: true or false

Validation​

Validation Option
Description
Expected Value
Make this field mandatoryWhen enabled, the form cannot be submitted without at least one tag selected.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Custom validationCustom validation rule using JavaScript expression.JavaScript expression that returns a validation message or empty string

Custom Validation Example​

{{components.tagsinput1.values.length >= 2 ? '' : 'Select at least 2 tags'}}

This validates that at least 2 tags are selected and shows an error message if not.

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.
Collapse when hiddenCollapses the component's space when it is hidden, so surrounding components fill the space. Takes effect when the app runs (preview or released app), not on the editor canvas.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.
TooltipProvides additional information on hover. Supports Plain text, Markdown, and HTML formats.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​

Property
Description
Configuration Options
ColorLabel text color.Select the color or click on fx and input code that programmatically returns a Hex color code.
SizeSets the font size of the label, in pixels. Defaults to 12.Enter a number or click on fx and enter code that returns a number.
AlignmentLabel position relative to the field.Side (left of field) or Top (above field).
DirectionLabel alignment when using Side layout.Left or Right.
WidthWhen Alignment is Side and Auto width is disabled, sets the label width.Enter the value or use the slider.
Width typeDetermines how label width is calculated.Of component (percentage of total component width) or Of field (percentage of field width).

Field​

Property
Description
Configuration 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 automatically assigns colors to chips from a predefined palette.Enable/disable the checkbox.
Chip colorBackground color of selected tag chips. Only visible when Auto pick chip color is OFF.Select the color or click on fx and input code that programmatically returns a Hex color code.
Text colorText color inside selected tags. Only visible when Auto pick chip color is OFF.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​

Property
Description
Configuration Options
PaddingPadding around the component.Default or None.

Advanced​

Property
Description
Configuration Options
CSS classAdds a custom CSS class to the component, which can be targeted using Custom Styles for advanced styling.Enter one or more class names.
info

The Advanced section is available only if your plan has the Custom Styles feature enabled.



Need Help?​