imitation
Tag
A short label or removable chip.
TagLabel and removable chip
DesignEngResearchOpsHarbour rebrandTideline mobile
DefaultInfoSuccessWarningError
In context
Task cardArea, project and due date as tags
Offline sync for tasks
EngTideline mobileDue 7 NovJW
Outlined small caps
TokensPadding, size, weight, tracking, case, fill and outline per tone: --rebar-tag-*.
This week
Props
| Prop | Type | Required | Default |
|---|---|---|---|
tone | TagTone | undefined | No | default |
closable | boolean | undefined | No | — |
onClose | (() => void) | undefined | No | — |
bionic | boolean | undefined | No | — |
bionicOptions | BionicOptions | undefined | No | — |
Accessibility
The close affordance is a real <button aria-label="Remove">: Tab to focus, Enter or Space to activate. The tone is colour only, so the label must carry the meaning.
data-rebar-* attributes
data-rebar-component="tag", data-rebar-tone, data-rebar-part="label" | "close".
Migrating to Ant Design
Not codemod-covered: AntD's Tag uses color (a preset name or hex) rather than a fixed tone union, so it is a semantic remap. closable/onClose map directly.
Tokens
Custom properties, set on the component or any ancestor. The default is what applies when one is unset. 3 of 30 were added in 1.1.0 and are marked.
| Property | Default | |
|---|---|---|
--rebar-tag-bg | var(--rebar-color-tint-2) | |
--rebar-tag-border-color | transparent | |
--rebar-tag-border-width | 1px | |
--rebar-tag-close-color | inherit | |
--rebar-tag-close-font-size | inherit | |
--rebar-tag-close-opacity | 0.6 | |
--rebar-tag-color | var(--rebar-color-text-primary) | |
--rebar-tag-error-bg | var(--rebar-color-tint-1) | |
--rebar-tag-error-border-color | transparent | |
--rebar-tag-error-color | var(--rebar-color-text-primary) | |
--rebar-tag-font-family | inherit | 1.1 |
--rebar-tag-font-size | var(--rebar-font-size-xs) | |
--rebar-tag-font-weight | var(--rebar-font-weight-semibold) | |
--rebar-tag-gap | var(--rebar-space-xs, 4px) | |
--rebar-tag-info-bg | var(--rebar-color-tint-3) | |
--rebar-tag-info-border-color | transparent | |
--rebar-tag-info-color | var(--rebar-color-text-primary) | |
--rebar-tag-label-display | inline | 1.1 |
--rebar-tag-label-gap | 0 | 1.1 |
--rebar-tag-letter-spacing | normal | |
--rebar-tag-line-height | 1.5 | |
--rebar-tag-padding | 2px 12px | |
--rebar-tag-radius | 999px | |
--rebar-tag-success-bg | var(--rebar-color-tint-4) | |
--rebar-tag-success-border-color | transparent | |
--rebar-tag-success-color | var(--rebar-color-text-primary) | |
--rebar-tag-text-transform | none | |
--rebar-tag-warning-bg | var(--rebar-color-tint-2) | |
--rebar-tag-warning-border-color | transparent | |
--rebar-tag-warning-color | var(--rebar-color-text-primary) |