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.

On this page

Import

Toggle Tag

Loading preview
Open in Storybook

Dismissible Tag

Loading preview
Open in Storybook

Props

NameDescriptionDefault
disabled

@deprecated use aria-disabled instead.

The disabled prop removes the element from the Accessibility Tree and prevents it from receiving focus. This is not recommended.

All DLS components are designed to use the aria-disabled property instead, which will style the component to be disabled, but still allow keyboard focus and screen reader interactivity.

boolean
-
aria-disabled

If true, styles component as disabled and prevents interactivity. Screen reader reads as "dimmed" or "disabled".

Booleanish
-
className

Additional CSS class names to apply to the tag.

string
-
aria-pressed

The pressed state of the clickable Tag

Booleanish
-
children

What is displayed within the Tag, typically text

ReactNode
-
onClick

The function that is called when the tag is clicked

MouseEventHandler<HTMLButtonElement>
-
isDismissible

If true, then show close icon and allow dismissing the tag

boolean
-
focusOnDismissRef

Optional ref to another element that should receive focus when the tag is dismissed

RefObject<HTMLElement>
-
reactlytics
ReactlyticsProp
-
labelOverrides

Overrides for labels that have been defaulted in the component.

TagLabelOverrides
-

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.