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 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 Scheme toggle Site status Skeleton Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed OverviewColor PalettesCustomizingDevelopers All PatternsAccordionCall 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 is a caption added to an element for better clarity and user convenience.

Slots 2

Slot Name Summary Description
[default]

Must contain the text for the label.
Note: [default] unnamed slots do not have a slot="name" attribute.

icon

Contains the labels's icon, e.g. web-icon-alert-success.

Attributes 7

Attribute DOM Property Description Type Default
icon icon

The icon to display in the tag.

IconNameFor<IconSetName>
unknown
icon-set iconSet

Icon set to display in the tag

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

The variant of the tag.

'filled' | 'outline' | 'desaturated'
'filled'
size size

The size of the tag.

'compact'
unknown
href href

optional href for linked tag.

string
unknown
disabled disabled

Whether an interactive tag is disabled.

boolean
false
color color

The color of the label. Note: 'cyan' will also work, but is deprecated

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

Methods 0

None

Events 1

Event Name Description
close

when a removable label's close button is clicked

CSS Shadow Parts 1

Part Name Summary Description
icon

container for the label icon

CSS Custom Properties 4

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

The padding at the start of the direction perpendicular to the flow of the text.

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

The padding at the end of the direction parallel to the flow of the text.

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

The padding at the end of the direction perpendicular to the flow of the text.

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

The padding at the start of the direction parallel to the flow of the text.

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

Design Tokens 74

Token Description Copy
--rh-length-3xs

2px length token

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

Tertiary surface (light theme)

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

Body text font family

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

14px font size

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

Regular font weight

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

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

1px border width; Example: Secondary CTA or Button

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

Pill border radius; Example: Label

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

3px border radius; Example: Card

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

4px spacer

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

2px border width: Example: Alert

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

12px font size

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

8px spacer

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

Brand red (light and dark theme)

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

Darker brand red

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

Lightest brand red

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

Dark brand red

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

Lighter brand red

Full CSS Variable Permalink to this token
--rh-color-red-orange-50
Full CSS Variable Permalink to this token
--rh-color-red-orange-70
Full CSS Variable Permalink to this token
--rh-color-red-orange-10
Full CSS Variable Permalink to this token
--rh-color-red-orange-20
Full CSS Variable Permalink to this token
--rh-color-red-orange-60
Full CSS Variable Permalink to this token
--rh-color-red-orange-30
Full CSS Variable Permalink to this token
--rh-color-orange-50

Label - Filled (Orange) accent color

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

Label - Filled (Orange) text color

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

Label - Filled (Orange) background color

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

Label - Filled (Orange) border color

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

Alert - Warning title text

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

Alert - Warning background

Full CSS Variable Permalink to this token
--rh-color-yellow-20
Full CSS Variable Permalink to this token
--rh-color-yellow-60
Full CSS Variable Permalink to this token
--rh-color-yellow-30
Full CSS Variable Permalink to this token
--rh-color-green-50
Full CSS Variable Permalink to this token
--rh-color-green-70

Alert - Success title text

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

Alert - success background

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

Label - Filled (Green) border color

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

Alert - Success accent

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

Alert - Default accent

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

Alert - Default title text

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

Alert - Default background

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

Label (Cyan) border color

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

Label - Filled (Blue) accent color

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

Alert - Info title text

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

Alert - Info background

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

Label - Filled (Blue) border color

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

Inline link hover (light theme)

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

Inline link (dark theme)

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

Inline link visited hover (light theme)

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

Label - Filled (Purple) background color

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

Inline link visited hover (dark theme)

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

Inline link visited (light theme)

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

Tertiary surface (light theme)

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

Secondary surface (light theme)

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

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

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

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

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

Subtle icon

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

Subtle borders (light theme)

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

Tertiary surface (dark theme)

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

Secondary text (light theme)

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

Subtle icon (hover state)

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