• Start
  • Blogg
  • Kom igång
  • Riktlinjer
  • Komponenter
  • Changelog
  • Tillgänglighet
  • Inställningar

Komponenter

Komponenter

​
​

Inga resultat hittade, prova med andra sökvillkor.

Badge

Badge

11.3.3

Badges are small status descriptors for UI elements. A badge usually consists of a small circle that appears in proximity to another object.

Demo
Props
Installation
Länkar
Tillgänglighet
Change log
Statistik

Demo

Props

Se fullständing dokumentation(öppnas i ny flik)
NamnTypBeskrivning

ariaHidden

booleanIf true, the badge's label will be hidden from screen readers while remaining visually visible.

ariaLabel

stringAccessible label for the badge container, useful when the badge conveys meaning through color alone (e.g. a small status dot).

customAttribute

{ attribute: string; value: string | number }Used for tests. Clickable and requested subcomponents will be suffixed with "-[ComponentName]".

isLoading

booleanIf true, a loading skeleton will be rendered instead of the component.

lang

"sv" | "en"The language of the badge's label.

negativeMargins

booleanNegative margins.

role

AriaRoleARIA role for the badge container, e.g. "img" for a purely visual status indicator.

wrapLabel

booleanIf true, the badge's label will be wrapped to the next line if it exceeds the width of the badge.

color

BadgeColor

elevation

never

label

never

labelPosition

never

labelVariant

never

size *

"sm"

Installation

Kodexempel
npm install @sj-ab/component-library.ui.badge

Länkar

  • Storybook

  • Figma

  • Bit.cloud

Tillgänglighet

Semantik

En Badge presenteras som vanlig text (<span>).

Färg som komplement

Se till att informationen som presenteras i en Badge går att förstå även för användare som inte kan se eller urskilja den färgade cirkeln.

Gul cirkel med text "45 min"

Använd inte färgen i sig för att förmedla viktig information, till exempel förseningar

Gul cirkel med text "Försenad"

Använd den färgade cirkeln som komplement och förstärkning för den synliga texten

Change log

  • Security updates and bit automatic vulnerabilites workflow fix

    11.1.2
  • Adds new dimension.borderRadius tokens and updates border radius usage throughout.

    11.1.0

Statistik

Importer av Badge

83

Repos med Badge

53%

Senaste installerade version av Badge

9.4.1

Äldsta installerade version av Badge