Introducing PrimeReact v11-alpha 🎉Discover Now

Tag

Tag is a label component used to categorize content.

DraftInfoActiveAttentionErrorFeaturedNewArchivedPendingVerified
preview

Installation#

npx shadcn@latest add @primereact/tag

Usage#

import { Tag } from '@/components/ui/tag';
<Tag>Label</Tag>

Examples#

Basic#

A small label for categorizing or marking items.

DraftInfoActiveAttentionErrorFeaturedNewArchivedPendingVerified
basic-demo

Severity#

Use severity property to define the severity of the tag.

PrimarySecondarySuccessInfoWarnDangerContrast
severity-demo

Pill#

Use rounded property to display a tag as a pill.

PrimarySecondarySuccessInfoWarnDangerContrast
pill-demo

Icon#

Place the icon left or right of the label.

PrimarySecondarySuccessInfoWarnDangerContrast
icon-demo

Template#

Children of the component are passed as the content for templating.

CountryItaly
template-demo

As button#

Use as="button" to display a tag as a button.

button-demo

Accessibility#

Screen Reader#

Tag does not include any roles and attributes by default, any attribute is passed to the root element so aria roles and attributes can be added if required.

Keyboard Support#

Component does not include any interactive elements.