Skip to content

Badge

hc-badge is a compact inline pill used to surface status next to a label. Variants are switched with data-variant.

DraftIn reviewActivePendingFailed
VariantUse for
omittedNeutral / unknown status.
infoInformational state (e.g. “In review”).
successHealthy / completed state.
warningNeeds attention soon.
errorFailed / error state.
  • A badge is a visual signal — the text inside is the accessible name. Avoid icon-only badges; if you need one, include visually-hidden text.
  • Color should not be the only differentiator. The variant labels (Active, Failed, …) carry the meaning. The color reinforces it.
  • For announceable state changes (e.g. an order moving from “Pending” to “Failed”), put the badge inside a region with aria-live="polite" rather than relying on the badge itself.
Token pathPurpose
badge.padding-x / -yInline / block padding.
badge.radiusBorder radius.
badge.font-sizeFont size.
badge.font-weightFont weight.
badge.{variant}.{bg,fg,border}Per-variant colors.
Show the generated CSS variables
--hc-badge-padding-x | -padding-y | -radius | -font-size | -font-weight
--hc-badge-default-bg | -fg | -border
--hc-badge-info-bg | -fg | -border
--hc-badge-success-bg | -fg | -border
--hc-badge-warning-bg | -fg | -border
--hc-badge-error-bg | -fg | -border
  • Alert — for prominent, block-level notices.
  • Table — common host for badges in a status column.