Ga naar de inhoud

Componenten

Badge

Een klein label voor status, aantallen en categorieën.

Gebruik

Basis

Shipped Draft Failed Live
HTML
<bs:bsui-stack direction="row" gap="2" justify="center">
  <bs:bsui-badge label="Shipped" variant="default" />
  <bs:bsui-badge label="Draft" variant="secondary" />
  <bs:bsui-badge label="Failed" variant="destructive" />
  <bs:bsui-badge label="Live" variant="success" />
</bs:bsui-stack>

Elke variant

Alle zeven stijlen, van de neutrale standaard tot de statuskleuren.

Default Secondary Outline Destructive Success Warning Info
HTML
<bs:bsui-stack direction="row" gap="2" justify="center">
  <bs:bsui-badge label="Default" variant="default" />
  <bs:bsui-badge label="Secondary" variant="secondary" />
  <bs:bsui-badge label="Outline" variant="outline" />
  <bs:bsui-badge label="Destructive" variant="destructive" />
  <bs:bsui-badge label="Success" variant="success" />
  <bs:bsui-badge label="Warning" variant="warning" />
  <bs:bsui-badge label="Info" variant="info" />
</bs:bsui-stack>

Statuslijst

Eén badge per rij verandert een gewone lijst in een statusoverzicht.

Build 4821 Passed
Build 4820 Cancelled
Build 4819 Failed
HTML
<bs:bsui-stack direction="column" gap="2">
  <bs:bsui-stack direction="row" gap="3" justify="space-between">
    <bs:bsui-text content="Build 4821" variant="body" tag="span" />
    <bs:bsui-badge label="Passed" variant="success" />
  </bs:bsui-stack>
  <bs:bsui-stack direction="row" gap="3" justify="space-between">
    <bs:bsui-text content="Build 4820" variant="body" tag="span" />
    <bs:bsui-badge label="Cancelled" variant="warning" />
  </bs:bsui-stack>
  <bs:bsui-stack direction="row" gap="3" justify="space-between">
    <bs:bsui-text content="Build 4819" variant="body" tag="span" />
    <bs:bsui-badge label="Failed" variant="destructive" />
  </bs:bsui-stack>
</bs:bsui-stack>

Attributen

AttribuutTypeStandaard
label richtext —
variant default secondary outline destructive success warning info default