Tag Component

Tag Field

Function: a!tagField()

Displays a list of short text labels with colored background to highlight important attributes.

See also: Tag Item

Parameters

Name Keyword Types Description

Label

label

Text

Text to display as the field label.

Label Position

labelPosition

Text

Determines where the label appears. Valid values:

  • "ABOVE" (default) Displays the label above the component.
  • "ADJACENT" Displays the label to the left of the component.
  • "COLLAPSED" Hides the label. The label will still be read by screen readers; see accessibility considerations for more information.
  • "JUSTIFIED" Aligns the label alongside the component starting at the edge of the page.

Instructions

instructions

Text

Supplemental text about this field.

Help Tooltip

helpTooltip

Text

Displays a help icon with the specified text as a tooltip. The tooltip displays a maximum of 500 characters. The help icon does not show when the label position is "COLLAPSED".

Tags

tags

List of Variant

List of tags to display. Configured using a!tagItem().

Alignment

align

Text

Determines alignment of the image(s). Valid values: "START", "CENTER", "END".

Accessibility Text

accessibilityText

Text

Additional text to be announced by screen readers. Used only for accessibility; produces no visible change.

Size

size

Text

Determines the size of the tags. Valid values: "SMALL", "STANDARD" (default).

Visibility

showWhen

Boolean

Determines whether the component is displayed on the interface. When set to false, the component is hidden and is not evaluated. Default: true.

Notes

  • If the tags parameter is null, contains an empty array, or only contains tag items with no text value, then the label and instructions render with no tags displayed.
  • If multiple tags are displayed in a narrow container, tags can wrap onto multiple lines. An individual tag will never be split onto two lines.

Examples

Copy and paste an example into the INTERFACE DEFINITION in EXPRESSION MODE to see it displayed.

Display Tags with Custom Colors

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
a!tagField(
  labelPosition: "COLLAPSED",
  tags: {
    a!tagItem(
      text: "Silver Member",
      backgroundColor: "#aaa9ad",
      textColor: "#ffffff"
    ),
    a!tagItem(
      text: "Corporate Partner",
      backgroundColor: "#990099"
    )
  },
  size: "STANDARD"
)

Displays the following:

Display Multiple Tags using Looping

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
a!localVariables(
  local!skills: {"Problem-Solving", "Communication", "Creativity", "Project Management"},
  a!tagField(
    label: "Skills",
    labelPosition: "ABOVE",
    tags: a!forEach(
      items: local!skills,
      expression: a!tagItem(
        text: fv!item,
        backgroundColor: "ACCENT"
      )
    ),
    size: "STANDARD"
  )
)

Displays the following:

The following patterns include usage of the Tag Component.

FEEDBACK