Tags

Tags show categories for a piece of content. Tags are always interactive. If you need a component that is not interactive, use badge instead.

Use Cases

User should be able to:

  • Select a tag
  • View the current select tag
  • Dismiss a tag
  • Navigate and interact with the component with assistive technology

Interaction and Style

Relevant WCAG Requirements

  • Info and Relationships

    Ensure information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text. This means use proper HTML elements to structure your content, so it makes sense when read by assistive technology.

    WCAG 2.1 Understanding 1.3.1
  • Name, Role, Value

    For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.

    WCAG 2.1 Understanding 4.1.2

Keyboard Navigation

KeyAction
TabFocuses on each tag sequentially.
Enter/SpacebarDismisses the tag (if dismissible).

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.