Tag
On this page
General guidelines
In general, use a tag when you want to draw attention to an element on the page or make it more searchable.
Tag vs. badge
These elements look very similar. The following guidance should help clarify when to use each.
Element | Use case |
---|---|
Tag |
|
Badge |
|
Chip |
|
Filled vs. Outlined styles
Use a filled tag to add more visual prominence. If you require a mix of clickable and non-clickable tags, consider using one type for clickable and another for non-clickable. Whatever convention you choose, be sure to maintain consistency throughout your UI.
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.
Clickable tags
Use a clickable tag for actions like directing a user to a new page.
Tag groups
Tag groups should be used when there are multiple tags assigned to an element. They can be used almost anywhere in a UI, but are commonly used in table views and description lists. Tag groups can be oriented either horizontally or vertically. Optionally, add icons to help distinguish them if they are all the same color.
Status
Color
Certain colors may indicate a status. For example, in general, green is considered positive and red is considered negative. This is not the rule in every single situation. Be careful about how tags are used to communicate something.
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, most colors can be used. Do not use red or red orange, those colors are reserved for failure or error states.
If text communicates a status, choose a color that corresponds with that status.
Icon
Include an icon where additional visual information is helpful. You can also use them to distinguish tags of the same color if needed. Ensure the icon makes sense when paired with text and color.
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 |
Responsive design
Tags in one row will break to two or more rows as viewport sizes get smaller.
Best practices
Mixing variants
Use any variant, but in different parts of the UI
Do not mix variants in the same element or area
Mixing sizes
Use any size, but in different parts of the UI
Do not mix sizes in the same element or area
Using icons
Use icons and their colors consistently
Do not hide icons or change their color
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.