Rost
← All components
component

Tag

A compact 20px label with small corners, for what a piece of content is about.

In codeContract: reviewGuidance: agreedContract on GitHubFigma 91:362
Default
Disabled

Hover, press or tab to one to see the other 3 states.

When to use

  • Used to say what something is about: a discipline, a platform, a topic.

When not to use

  • A status: Badge. A filter: Chip.

Behaviour

One type (Primary) and five states. The hover and press states are there for tags that link to a filtered list. A tag that doesn't go anywhere shouldn't have them.

Accessibility

  • Static: a <span>, or <li> items in a <ul> when there are a few.
  • Linking: an <a> whose name gives the context ("Projects tagged Fintech").
  • Focus: focus-ring, only on tags that link.

Content

One word if you can. Capitals only for proper nouns.

Props

PropTypeValuesDefault
typeenumPrimaryPrimary

States: Default, Hover, Pressed, Focus, Disabled.

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

PartPropertyValueToken
rootjustify-contentcenterlayout
rootalign-itemscenterlayout
rootdisplayinline-flexlayout
rootvertical-alignmiddlelayout
rootpositionrelativelayout
roottext-decorationnoneFigma frame size
rootgap8pxspacing/gap/small
rootheight20pxspacing/size/xsmall
rootpadding-bottom2pxspacing/gap/3xsmall
rootpadding-top0pxspacing/gap/none
rootpadding-left8pxspacing/gap/small
rootpadding-right8pxspacing/gap/small
rootborder-radius4pxspacing/radius/xsmall
rootbackground#3a3a3aactions/secondary/regular/default/background
rootoutlinenoneFigma frame size
labelflex-shrink0layout
labelwhite-spacenowraplayout
labeltext-aligncenterlayout
labelpositionrelativelayout
labelfont-family'General Sans Variable'font-family/base
labelfont-weight500typography/label/font-weight/medium
labelline-height14pxtypography/label/line-height
labelcolor#d3d9d5actions/secondary/regular/default/label
labelfont-size12pxtypography/label/font-size
labelletter-spacing0pxtypography/label/letter-spacing
focus-ringdisplaynonelayout
focus-ringpositionabsolutelayout
focus-ringinsetcalc(-1 * var(--spacing-gap-2xsmall))layout
focus-ringborder-stylesolidno token yet
focus-ringborder-width2pxspacing/outline/medium
focus-ringborder-color#999actions/secondary/regular/focus/focus-ring
focus-ringborder-radius8pxspacing/radius/small
focus-ringpointer-eventsnoneFigma frame size

Changes by variant

focus-ring.display1
type=Primary, state=Focusblocklayout
label.color4
type=Primary, state=Hover#edededactions/secondary/regular/hover/label
type=Primary, state=Pressed#d3d9d5actions/secondary/regular/pressed/label
type=Primary, state=Focus#d3d9d5actions/secondary/regular/focus/label
type=Primary, state=Disabled#d3d9d5actions/secondary/regular/disabled/label
root.background4
type=Primary, state=Hover#747573actions/secondary/regular/hover/background
type=Primary, state=Pressed#999actions/secondary/regular/pressed/background
type=Primary, state=Focus#3a3a3aactions/secondary/regular/focus/background
type=Primary, state=Disabled#3a3a3aactions/secondary/regular/disabled/background
root.opacity1
type=Primary, state=Disabled0.24opacity/gentle