Tag
Names a category or a topic in a colour that follows the name, so the same key wears the same tint on every page and every visit, and leads to its topic when given a link.
Examples
Private credit launches in Europe, third quarter
| Export fails on large files | bugexport |
| Dark theme for the report view | designtheme |
| Invoice totals round up | billingbuginvoicesroundingexport |
| Rename the saved views menu | None |
Variants
Hue
designbillingsearchmobile
hueFor(key), hashed from the key or pinned in a map, so a key is the same colour everywhere.archiveduntagged
Size
Quarterly reportfinance
States
designbillingsearchmobileaccountsexporttheme
Research and development, long term
Usage
Use it when
- A thing belongs to a category or a topic that appears on more than one screen, and you find it by colour before reading it.
- A list filters or groups by the same keys, and the tag leads to the filtered list.
Use something else when
- The label is a state you read, such as "Draft", or a count. Use Badge instead, which has the same box without a hue.
- The label is a filter that is on or off. Use Pill instead.
- The label is an action with an effect other than navigation. Use Button instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/tag.jsonimport { Tag, TagRow, tagHueClassName, type TagProps, type TagRowProps } from "@/components/cobalt/ui/tag"