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.

Similar Components

Badge

Badge is a component that emphasizes the status of an item to make it immediately recognizable.

NativeTable

NativeTable is a component for efficiently organizing and displaying data.

Stat

Stat is used to display numbers or data within a box.

Table

Table is a table component equipped with column sorting, row selection, and click event features.

AreaChart

AreaChart is a component for drawing area charts to compare multiple sets of data.

BarChart

BarChart is a component for drawing bar charts to compare multiple sets of data.

Card

Card is a component that groups and displays related information. By default, it renders a article element.

ComposedChart

ComposedChart is a component for drawing composed charts to compare multiple sets of data.

Uses Components & Hooks