Tag
On this page
General guidelines
In general, use a tag to draw attention to an element on the page or make it more searchable.
Tag vs. badge
Although these elements look very similar, the following guidance should help clarify when to use each.
Element | Use cases |
---|---|
Tag |
|
Badge |
|
Chip |
|
Desaturated style
Use a desaturated tag to reduce visual prominence or to better fit a specific theme or visual style.
Default vs. Compact sizes
When you need to use a tag, use the Default size first. If there are space limitations and using a tag is required, use the Compact size instead.
Tag groups
Tags can be grouped next to an element or in the same space. Tag groups can be used almost anywhere and are oriented either horizontally or vertically. Tags that are grouped should use the same style, but show different colors. Text-only tags and link tags may be used in the same group.
Helpful tip
There is no set order of color, but try putting the most important information first. Using a decorative icon in every tag in a group is optional.
Status
Color
Certain colors may indicate a status. Be careful about how tags are used to communicate something. For example, in general, green is considered positive and red is considered negative. This is not the rule in every single situation.
To learn more about color as a status, go to the Color section.
Warning
Relying on color alone to communicate information causes barriers to access for many users. Learn more in the accessibility section.
Text
If text is descriptive or generic enough, most colors can be used. However, do not use red or red orange, those colors are always reserved for failure or error states.
If text communicates a status, choose a color that corresponds with that status.
Icons
Include an icon where additional visual information is helpful and ensure that it makes sense when paired with text. Use filled icons for Filled style tags and line icons for Outlined and Desaturated style tags. If a filled icon does not exist in the library, it is acceptable to use the line version.
Writing content
Text in tags should add clarity or context using as few words as possible. If text needs to be longer, add text somewhere else or use another element instead.
Character count
Element | Character count |
---|---|
Text | 25 |
Interactivity
You can use a tag as a link. To use a tag in a button for actions like triggering a Popover, read about our tag pattern.
To see tag interaction states, go to the Style page.
Responsive design
Tags in one row will break to two or more rows as viewport sizes get smaller.
Best practices
Mixing variants
Use any tag style, but use them consistently.
Do not mix tag styles in the same area.
Mixing sizes
Use any tag size, but use them consistently.
Do not mix tag sizes in the same area.
Using icons
Use decorative icons, but ensure that each makes sense when paired with text.
Do not use decorative icons that cause confusion or take away from the meaning of text.
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.