Skip to main content Home About the Design SystemRoadmap OverviewDesignersDevelopers OverviewColorGridIconographyInteractionsSpacingTypography Overview Global colorBox shadowTypographyBorderOpacitySpaceLengthIconBreakpointsMedia queries All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button group Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Menu dropdown Navigation link Navigation (primary) Navigation (secondary) Navigation (vertical) Pagination PopoverPlanned Progress stepper Readtime Scheme toggle Select Site status Skeleton Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed OverviewColor PalettesCustomizingDevelopers All PatternsAccordionAlertCall to ActionCardFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTabsTagTile All Personalization PatternsAnnouncement FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers Design/code status Release notes Get support

Tag

OverviewStyleGuidelinesCodeAccessibilityDemos
ImportingUsagerh-tagImportingUsagerh-tag

Importing

Add rh-tag to your page with this import statement:

<script type="module">
  import '@rhds/elements/rh-tag/rh-tag.js';
</script>
Copy to Clipboard Wrap lines

To learn more about installing RHDS elements on your site using an import map read our getting started docs.

Usage

<rh-tag>Tag</rh-tag>

<script type="module">
  import '@rhds/elements/rh-tag/rh-tag.js';
</script>
Copy to Clipboard Wrap lines

rh-tag

A tag provides a short, pill-shaped label for categorizing content or indicating status. It should include an icon when color alone conveys meaning. Linked tags must have descriptive text for screen readers, and should provide an aria-label on group containers. When disabled, Enter keyboard navigation is suppressed on linked tags.

Theming

Themable

This element uses Red Hat design system theming and can be used in themable contexts.

Slots 2

Slot Name Summary Description
[default]

tag text content for screen readers and visual display

Expects inline text. Text must convey meaning without relying on color alone (WCAG 1.4.1). Keep under 25 characters.
Note: [default] unnamed slots do not have a slot="name" attribute.

icon

decorative icon for screen reader and visual context

Expects an rh-icon element or inline svg. Icons must be purely decorative. Screen readers skip this slot because the icon has no accessible name.

Attributes 7

Attribute DOM Property Description Type Default
icon icon

The name of the icon to display in the tag. When set, an rh-icon element renders in the icon slot as a decorative visual.

IconNameFor<IconSetName>
unknown
icon-set iconSet

The icon set from which to select the icon. Defaults to ui.

'ui' | 'standard' | 'social' | 'microns'
'ui'
variant variant

The visual style variant of the tag.

  • filled: colored background with a subtle border (default)
  • outline: transparent background with a colored border
  • desaturated: transparent background with a neutral border and text color
'filled' | 'outline' | 'desaturated'
'filled'
size size

The size of the tag. When set to compact, the tag uses a smaller font size and reduced padding.

'compact'
unknown
href href

Optional URL that makes the tag a navigable link. When set, the tag renders an anchor element around its text content.

string
unknown
disabled disabled

Whether an interactive (linked) tag is disabled. When true, the tag visually appears inactive and keyboard navigation is suppressed.

boolean
false
color color

The color palette of the tag. Nine colors are available. Choose colors that correspond to the tag's semantic meaning (e.g. red for errors, green for success). Defaults to gray.

Note: cyan is accepted but deprecated; use teal instead.

'red' | 'red-orange' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple' | 'gray'
unknown

Methods 0

None

Events 0

None

CSS Shadow Parts 1

Part Name Summary Description
icon

decorative icon for screen reader and visual context

Expects an rh-icon element or inline svg. Icons must be purely decorative. Screen readers skip this slot because the icon has no accessible name.

CSS Custom Properties 4

CSS Property Description Default
--rh-tag-padding-block-start

Tag block-start padding

Compact block-start padding

0
--rh-tag-padding-inline-end

Tag inline-end padding

var(--rh-space-md, 8px)
--rh-tag-padding-block-end

Tag block-end padding

Compact block-end padding

0
--rh-tag-padding-inline-start

Tag inline-start padding

var(--rh-space-md, 8px)

Design Tokens 74

Token Description Copy
--rh-length-3xs

Offset between the link text and its dashed underline

2px length token

Full CSS Variable Permalink to this token
--rh-color-surface-lighter

Tag pill background color, varies by color and variant

Tertiary surface (light theme)

Full CSS Variable Permalink to this token
--rh-font-family-body-text

Text font family

Body text font family

Full CSS Variable Permalink to this token
--rh-font-size-body-text-sm

Text size

14px font size

Full CSS Variable Permalink to this token
--rh-font-weight-body-text-regular

Text weight

Regular font weight

Full CSS Variable Permalink to this token
--rh-line-height-body-text

Body text line height

Line height for body text

Full CSS Variable Permalink to this token
--rh-size-icon-01

16px icon box

Full CSS Variable Permalink to this token
--rh-border-width-sm

Container border width

1px border width; Example: Secondary CTA or Button

Full CSS Variable Permalink to this token
--rh-color-border-subtle

Container border color

Full CSS Variable Permalink to this token
--rh-border-radius-pill

Pill-shaped border radius for the tag container

Pill-shaped border radius matching the container

Pill border radius; Example: Label

Full CSS Variable Permalink to this token
--rh-border-radius-default

Focus ring border radius for the inner text area

3px border radius; Example: Card

Full CSS Variable Permalink to this token
--rh-space-xs

Icon to text gap

4px spacer

Full CSS Variable Permalink to this token
--rh-border-width-md

Thicker border on hover for visual feedback

Focus ring outline width

2px border width: Example: Alert

Full CSS Variable Permalink to this token
--rh-color-border-interactive

Focus ring outline color

Full CSS Variable Permalink to this token
--rh-font-size-body-text-xs

Compact variant uses a smaller text size

12px font size

Full CSS Variable Permalink to this token
--rh-space-md

Compact inline-end padding

Compact inline-start padding

8px spacer

Full CSS Variable Permalink to this token
--rh-color-red-50

Red tag border in dark mode

Brand red (light and dark theme)

Full CSS Variable Permalink to this token
--rh-color-red-70

Red tag fill in dark mode

Red text in light mode

Darker brand red

Full CSS Variable Permalink to this token
--rh-color-red-10

Red tag fill in light mode

Red text in dark mode

Full CSS Variable Permalink to this token
--rh-color-red-20

Red outline icon in dark mode

Lightest brand red

Full CSS Variable Permalink to this token
--rh-color-red-60

Red icon in light mode

Red outline icon in light mode

Red outline text in light mode

Dark brand red

Full CSS Variable Permalink to this token
--rh-color-red-30

Red tag border in light mode

Red icon in dark mode

Red outline text in dark mode

Lighter brand red

Full CSS Variable Permalink to this token
--rh-color-red-orange-50

Red orange tag border in dark mode

Full CSS Variable Permalink to this token
--rh-color-red-orange-70

Red orange tag fill in dark mode

Red orange text in light mode

Full CSS Variable Permalink to this token
--rh-color-red-orange-10

Red orange tag fill in light mode

Red orange text in dark mode

Full CSS Variable Permalink to this token
--rh-color-red-orange-20

Red orange outline icon in dark mode

Full CSS Variable Permalink to this token
--rh-color-red-orange-60

Red orange icon in light mode

Red orange outline icon in light mode

Red orange outline text in light mode

Full CSS Variable Permalink to this token
--rh-color-red-orange-30

Red orange tag border in light mode

Red orange icon in dark mode

Red orange outline text in dark mode

Full CSS Variable Permalink to this token
--rh-color-orange-50

Orange tag border in dark mode

Label - Filled (Orange) accent color

Full CSS Variable Permalink to this token
--rh-color-orange-70

Orange tag fill in dark mode

Orange text in light mode

Label - Filled (Orange) text color

Full CSS Variable Permalink to this token
--rh-color-orange-10

Orange tag fill in light mode

Orange text in dark mode

Label - Filled (Orange) background color

Full CSS Variable Permalink to this token
--rh-color-orange-20

Orange outline icon in dark mode

Full CSS Variable Permalink to this token
--rh-color-orange-60

Orange icon in light mode

Orange outline icon in light mode

Orange outline text in light mode

Full CSS Variable Permalink to this token
--rh-color-orange-30

Orange tag border in light mode

Orange icon in dark mode

Orange outline text in dark mode

Label - Filled (Orange) border color

Full CSS Variable Permalink to this token
--rh-color-yellow-50

Yellow tag border in dark mode

Full CSS Variable Permalink to this token
--rh-color-yellow-70

Yellow tag fill in dark mode

Yellow text in light mode

Alert - Warning title text

Full CSS Variable Permalink to this token
--rh-color-yellow-10

Yellow tag fill in light mode

Yellow text in dark mode

Alert - Warning background

Full CSS Variable Permalink to this token
--rh-color-yellow-20

Yellow outline icon in dark mode

Full CSS Variable Permalink to this token
--rh-color-yellow-60

Yellow icon in light mode

Yellow outline icon in light mode

Yellow outline text in light mode

Full CSS Variable Permalink to this token
--rh-color-yellow-30

Yellow tag border in light mode

Yellow icon in dark mode

Yellow outline text in dark mode

Full CSS Variable Permalink to this token
--rh-color-green-50

Green tag border in dark mode

Full CSS Variable Permalink to this token
--rh-color-green-70

Green tag fill in dark mode

Green text in light mode

Alert - Success title text

Full CSS Variable Permalink to this token
--rh-color-green-10

Green tag fill in light mode

Green text in dark mode

Alert - success background

Full CSS Variable Permalink to this token
--rh-color-green-20

Green outline icon in dark mode

Label - Filled (Green) border color

Full CSS Variable Permalink to this token
--rh-color-green-60

Green icon in light mode

Green outline icon in light mode

Green outline text in light mode

Alert - Success accent

Full CSS Variable Permalink to this token
--rh-color-green-30

Green tag border in light mode

Green icon in dark mode

Green outline text in dark mode

Full CSS Variable Permalink to this token
--rh-color-teal-50

Teal tag border in dark mode

Alert - Default accent

Full CSS Variable Permalink to this token
--rh-color-teal-70

Teal tag fill in dark mode

Teal text in light mode

Alert - Default title text

Full CSS Variable Permalink to this token
--rh-color-teal-10

Teal tag fill in light mode

Teal text in dark mode

Alert - Default background

Full CSS Variable Permalink to this token
--rh-color-teal-20

Teal outline icon in dark mode

Full CSS Variable Permalink to this token
--rh-color-teal-60

Teal icon in light mode

Teal outline icon in light mode

Teal outline text in light mode

Full CSS Variable Permalink to this token
--rh-color-teal-30

Teal tag border in light mode

Teal icon in dark mode

Teal outline text in dark mode

Label (Cyan) border color

Full CSS Variable Permalink to this token
--rh-color-blue-50

Blue tag border in dark mode

Label - Filled (Blue) accent color

Full CSS Variable Permalink to this token
--rh-color-blue-70

Blue tag fill in dark mode

Blue text in light mode

Alert - Info title text

Full CSS Variable Permalink to this token
--rh-color-blue-10

Blue tag fill in light mode

Blue text in dark mode

Alert - Info background

Full CSS Variable Permalink to this token
--rh-color-blue-20

Blue outline icon in dark mode

Label - Filled (Blue) border color

Full CSS Variable Permalink to this token
--rh-color-blue-60

Blue icon in light mode

Blue outline icon in light mode

Blue outline text in light mode

Inline link hover (light theme)

Full CSS Variable Permalink to this token
--rh-color-blue-30

Blue tag border in light mode

Blue icon in dark mode

Blue outline text in dark mode

Inline link (dark theme)

Full CSS Variable Permalink to this token
--rh-color-purple-50

Purple tag border in dark mode

Full CSS Variable Permalink to this token
--rh-color-purple-70

Purple tag fill in dark mode

Purple text in light mode

Inline link visited hover (light theme)

Full CSS Variable Permalink to this token
--rh-color-purple-10

Purple tag fill in light mode

Purple text in dark mode

Label - Filled (Purple) background color

Full CSS Variable Permalink to this token
--rh-color-purple-20

Purple outline icon in dark mode

Inline link visited hover (dark theme)

Full CSS Variable Permalink to this token
--rh-color-purple-60

Purple icon in light mode

Purple outline icon in light mode

Purple outline text in light mode

Inline link visited (light theme)

Full CSS Variable Permalink to this token
--rh-color-purple-30

Purple tag border in light mode

Purple icon in dark mode

Purple outline text in dark mode

Full CSS Variable Permalink to this token
--rh-color-gray-10

Gray tag fill in light mode

Gray text in dark mode

Tertiary surface (light theme)

Full CSS Variable Permalink to this token
--rh-color-gray-20

Gray outline icon in dark mode

Secondary surface (light theme)

Full CSS Variable Permalink to this token
--rh-color-white

Outline variant fill in light mode

Lightest surface (light theme) or primary text (dark theme)

Full CSS Variable Permalink to this token
--rh-color-gray-95

Outline variant fill in dark mode

Primary surface (dark theme) or primary text (light theme)

Full CSS Variable Permalink to this token
--rh-color-gray-50

Gray tag border in dark mode

Outline variant border in dark mode

Subtle icon

Full CSS Variable Permalink to this token
--rh-color-text-primary

Desaturated border color

Desaturated icon color

Desaturated text color

Full CSS Variable Permalink to this token
--rh-color-gray-30

Gray tag border in light mode

Gray icon in dark mode

Gray outline text in dark mode

Outline variant border in light mode

Disabled fill in light mode

Disabled border in light mode

Subtle borders (light theme)

Full CSS Variable Permalink to this token
--rh-color-gray-70

Gray tag fill in dark mode

Gray text in light mode

Disabled fill in dark mode

Disabled border in dark mode

Tertiary surface (dark theme)

Full CSS Variable Permalink to this token
--rh-color-gray-60

Gray icon in light mode

Gray outline icon in light mode

Gray outline text in light mode

Disabled icon in light mode

Disabled text in light mode

Secondary text (light theme)

Full CSS Variable Permalink to this token
--rh-color-gray-40

Disabled icon in dark mode

Disabled text in dark mode

Subtle icon (hover state)

Full CSS Variable Permalink to this token
© 2026 Red Hat Deploys by Netlify