Badge

Alignment target:@astryxdesign/core v0.7.1 · Badge

Shipped
<Badge
  label="Shipped"
  variant="success"
/>

Props #

NameTypeDefaultDescription
variantBadgeVariant'neutral'Sets the visual variant of the badge. Optional: neutral, info, success, warning, error, blue, cyan, green, orange, pink, purple, red, teal, yellow.
labelstring | number-Badge text. Give the text here or through the default slot; the slot wins when both are set. A badge is one line and at least as tall as that line, so it grows with a larger text size. It is as wide as its label, so it does not stretch to fill a grid cell or a stack; a label wider than the space available ends in an ellipsis, and a string or number label is also set as the title.

Slots #

NameDescription
defaultText content displayed by the badge.
iconOptional leading icon. An icon should not replace the text label.

Native attributes #

The root element is <span>.

The root element receives:

  • HTML attributes.
  • aria-* attributes.
  • data-* attributes.
  • class.
  • style.
  • Native event listeners.

Badge is a read-only indicator. Do not add interactive behavior.