Zur Navigation Zum Inhalt Kontakt Menu Trouver un composant Aperçu Lyne Principes Bases Accessibilité Système de design Guidelines Deutsch Français Italiano English Nos principes de design Centré sur l’utilisateur Reconnaissable Inclusif Minimaliste Holistique Auto-explicatif Axé sur les tâches Approprié Portail de la marque CFF Logo Horloge numérique Droits d’utilisation Couleurs de base Couleurs fonctionnelles Couleurs off-brand Icônes Icônes de l’horaire Pictogrammes À propos de l’accessibilité À propos de ce guide Contact Informations complémentaires Product Owner User Research Interaction Design Visual Design Development Content Design Testing What is a design system? Conception Développer FAQ Aide Procès Contribution Contact Aperçu Base Composants Overview Releases Design Tokens Komponenten Aperçu Base Informations Aperçu Base Composants Sens & objectif Community Assets Instructions Power-Apps Bandeaux publicitaires numériques SAP Icônes d’applications Cette page n'est pas disponible dans la langue souhaitée. Langues disponibles Deutsch English Card-Badge Info

Was macht die Komponente?

Sie ist Teil der Card-Komponente.

Wann soll die Komponente eingesetzt werden?

  • Nur innerhalb der Card-Komponente.

Übergeordnete Komponenten

Card
Anatomie
Anatomie der Komponente
Nummer Typ Beschreibung Optional Hinweis
1 Slot Beliebiger Inhalt erlaubt Nein
2 Komponente sbb-card-badge Ja
Demo

Spielwiese

%from CHF92.50Black Friday
Farbe Charcoal White Hintergrund White Milk Iron Charcoal Black

Beispiele

Charcoal
White
HTML-Markup kopiert.
Implementation

The sbb-card-badge can contain some information like prices or discounts,
and can be used in sbb-card or
sbb-selection-expansion-panel.

To achieve the correct spacing between elements inside the card badge, we recommend to use span-elements.
All content parts are presented with a predefined gap in between.

<sbb-card>
  <sbb-card-badge aria-label="Super saver sales ticket price starts at CHF 19.99">
    <span>%</span>
    <span>from CHF</span>
    <span>19.99</span>
  </sbb-card-badge>
  Card content...
</sbb-card>

Accessibility

It's recommended to place an aria-label on sbb-card-badge to describe the displayed information in a full sentence,
as in the example above.

Properties

Name Attribute Privacy Type Default Description
color color public 'charcoal' | 'white' 'charcoal' Color of the card badge.

Slots

Name Description
Use the unnamed slot to add content to the badge. Content parts should be wrapped in <span> tags to achieve correct spacings.
Impressum Contact Paramètres des cookies