Zur Navigation Zum Inhalt Kontakt Menu Komponente finden Übersicht Lyne Prinzipien Grundlagen Barrierefreiheit Design System Guidelines Deutsch Français Italiano English Unsere Gestaltungsprinzipien Nutzerzentriert Wiedererkennbar Inklusiv Reduziert Ganzheitlich Selbsterklärend Aufgabenorientiert Passend SBB Markenportal Logo Digitale Uhr Nutzungsrechte Basis-Farben Funktionale Farben Off-Brand Farben Icons Fahrplan-Icons Piktogramme Über Barrierefreiheit Über diesen Guide Kontakt Weitere Informationen Product Owner User Research Interaction Design Visual Design Development Content Design Testing Was ist ein Design System?​ Designing Coding FAQ Hilfe Prozess Contribution Kontakt Übersicht Basis Komponenten Übersicht Basis Komponenten Übersicht Basis Komponenten Übersicht Releases Design Tokens Komponenten Übersicht Basis Informationen Sinn & Zweck Community Assets Anleitung Power-Apps Digitale Werbebanner SAP App Icons
Komponente finden

Lyne

Basics Animation Animation Border Border Grid Grid Spacings Spacings Typografie Typografie Components Accordion Accordion Action-Group Action-Group Alert Alert Alert-Group Alert-Group Autocomplete Autocomplete Breadcrumb Breadcrumb Breadcrumb-Group Breadcrumb-Group Button Button Calendar Calendar Card Card Card-Action Card-Action Card-Badge Card-Badge Checkbox Checkbox Checkbox-Group Checkbox-Group Chip Chip Clock Clock Container Container Datepicker Datepicker Dialog Dialog Divider Divider Expansion-Panel Expansion-Panel File-Selector File-Selector Footer Footer Form-Error Form-Error Form-Field Form-Field Form-Field-Clear Form-Field-Clear Header Header Header-Action Header-Action Icon Icon Image Image Journey-Header Journey-Header Link Link Link-List Link-List Loading-Indicator Loading-Indicator Logo Logo Menu Menu Menu-Action Menu-Action Message Message Navigation Navigation Navigation-Action Navigation-Action Navigation-List Navigation-List Navigation-Marker Navigation-Marker Navigation-Section Navigation-Section Notification Notification Popover Popover Popover-Trigger Popover-Trigger Radio-Button Radio-Button Radio-Button-Group Radio-Button-Group Select Select Selection-Panel Selection-Panel Signet Signet Skiplink-List Skiplink-List Slider Slider Status Status Sticky-Bar Sticky-Bar Tab-Group Tab-Group Tab Title Tab Title Tag Tag Tag-Group Tag-Group Teaser Teaser Teaser-Hero Teaser-Hero Time-Input Time-Input Title Title Toast Toast Toggle Toggle Toggle-Check Toggle-Check
Card Implementation

The sbb-card component is a generic content container; its task is to contain content related to a single subject.

<sbb-card>Card content</sbb-card>

Slots

The content is projected in an unnamed slot.
It's possible to use the component together with the sbb-card-badge and the sbb-card-action.

With sbb-card-badge

The sbb-card-badge component can be used to display a badge in the upper right corner.
The badge is hidden with card sizes are xs or s.
For API details, see the sbb-card-badge docs.

<sbb-card size="m" color="white">
  <sbb-card-badge>
    <span>%</span>
    <span>from CHF</span>
    <span>19.99</span>
  </sbb-card-badge>
  Card content
</sbb-card>

With sbb-card-action

To add an action to a card, add a sbb-card-action to the main slot.
With the sbb-card-action all the card area becomes clickable.
For API details (mainly accessibility), see the sbb-card-action docs.

<sbb-card>
  <sbb-card-action href="https://www.sbb.ch"
    >Check all the wonderful trips available.</sbb-card-action
  >
  Buy trips
</sbb-card>

Style

It's possible to choose among seven different values for the size property (from xs to xxxl, default m);
the choice mainly affects the content's padding.

<sbb-card size="xs">Card content</sbb-card>
<sbb-card size="s">Card content</sbb-card>
<sbb-card size="m">Card content</sbb-card>
<sbb-card size="l">Card content</sbb-card>
<sbb-card size="xl">Card content</sbb-card>
<sbb-card size="xxl">Card content</sbb-card>
<sbb-card size="xxxl">Card content</sbb-card>

The component has four different values to choose from for the color property; default is white.

<sbb-card color="milk">Card content</sbb-card>
<sbb-card color="transparent-bordered">Card content</sbb-card>
<sbb-card color="transparent-bordered-dashed">Card content</sbb-card>

Accessibility

Normally, a sbb-card should be a single action, however, it's possible to place other interactive elements
in the card content. Interactive content will automatically be detected and made accessible to click / focus.
In cases where there should be only a visual button or link inside the card content without a different action, the
is-static attribute should be set (e.g. <sbb-button is-static></sbb-button>).

Windows High Contrast Notes

In high contrast mode, all the content of a link or a button receives a specific color which overrides every other color.

However, as the content of the card is not directly inside the button or link,
this does not happen when the slotted content has a specific color set.
To improve coloring, it's needed to manually define styles for Window high contrast mode (setting LinkText or ButtonText).

Properties

Name Attribute Privacy Type Default Description
size size public 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl' 'm' Size variant, either xs, s, m, l, xl, xxl or xxxl.
color color public | 'white' | 'milk' | 'transparent-bordered' | 'transparent-bordered-dashed' 'white' Option to set the component's background color.

Slots

Name Description
Use the unnamed slot to add content to the card.
badge Use this slot to render a sbb-card-badge component.
action Use this slot to render a sbb-card-action component.
Demo

Interaktiv

Buy a ticket%from CHF92.50Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec porttitor blandit odio, ut blandit libero cursus vel. Nunc eu congue mauris. Quisque sed facilisis leo. Curabitur malesuada, nibh ac blandit vehicula, urna sem scelerisque magna, sed tincidunt neque arcu ac justo.

Statisch

%from CHF92.50Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec porttitor blandit odio, ut blandit libero cursus vel. Nunc eu congue mauris. Quisque sed facilisis leo. Curabitur malesuada, nibh ac blandit vehicula, urna sem scelerisque magna, sed tincidunt neque arcu ac justo.
Farbe Milk White Grössen XS S M L XL XXL Aktiv Nein Ja Badge Nein Ja Hintergrund White Milk Iron Charcoal Black
Beispiele Color White
Color Milk
Color Transparent
Color Transparent Bordered Dashed
Size XS
Size S
Size M
Size L
Size XL
Size XXL
Size XXXL
Size M With Badge
Size L With Badge
Size XL With Badge
Size XXL With Badge
Size XXXL With Badge
Link
Button
Button Active
Button Active Milk
Button Active Transparent Bordered
Button Active Transparent Bordered Dashed
Button With Sbb Badge
Link With Sbb Badge
Link Active With Sbb Badge
Fixed Height
Multiple
HTML-Markup kopiert.
Impressum Kontakt Cookie Einstellungen