Tag

Tag is a component used to categorize or organize items using keywords that describe them.

Tag

Usage

import { Tag } from "@yamada-ui/react"
<Tag />

Change Variants

solidsubtlesurfaceoutline

Change Size

smmdlg

Change Color Scheme

successwarningerror

Use with Icon

startIconendIcon

Use Close Button

Tag

Disable Close Button

Tag

Props

Accessibility

Tag displays a close button when onClose is set. The aria-label of this close button is set to "Close tag" by default. If you want to change the aria-label to a custom value, set the aria-label in closeButtonProps.

<Tag onClose={() => {}} closeButtonProps={{ "aria-label": "Close custom tag" }}>
  Tag
</Tag>

Keyboard Navigation

KeyDescriptionState
TabMoves focus to the close button.TagCloseButton
Enter, SpaceExecutes the focused close button.TagCloseButton

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
TagCloseButtonrole="button"Indicates that this is a close button.
aria-labelSets to "Close tag".
aria-disabledSets to "true" if disabled is set.