Tag Component

Function

a!tagField( label, labelPosition, instructions, helpTooltip, tags, align, accessibilityText, size, showWhen )

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

See also: Tag Item, Tag design guidance

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.

Usage considerations

Using the tag parameter with text values

  • 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

Use the interactive editor below to test out your code:

Display tags with custom colors

Display multiple tags using looping

The following patterns include usage of the Tag Component.

Open in Github Built: Wed, Aug 16, 2023 (04:37:39 PM)

On This Page

FEEDBACK