Zur Navigation Zum Inhalt Kontakt Menu Find component Overview Lyne Principles Foundation Accessibility Design System Guidelines Deutsch Français Italiano English Our design principles User-centred Recognisable Inclusive Reduced Holistic Self-explanatory Task-oriented Appropriate SBB Brand portal Logo Digital clock Rights of use Base colors Functional colors Off brand colors Icons Timetable icons Pictograms About accessibility Über diesen Guide Contact Further information Product Owner User Research Interaction Design Visual Design Development Content Design Testing What is a design system? Designing Coding FAQ Help Process Contribution Contact Overview Base Components Overview Base Components Overview Base Components Overview Design Tokens Components Overview Base Informationen Sense & Purpose Community Assets Instructions Power-Apps Digital banner ads SAP Design Guidelines App Icons
Find component

Lyne

Basics Animation

Animation

Border

Border

Grid

Grid

Spacings

Spacings

Typography

Typography

Components Action-Group

Action-Group

Alert

Alert

Alert-Group

Alert-Group

Autocomplete

Autocomplete

Button

Button

Calendar

Calendar

Card

Card

Card-Badge

Card-Badge

Checkbox

Checkbox

Checkbox-Group

Checkbox-Group

Chip

Chip

Clock

Clock

Datepicker

Datepicker

Dialog

Dialog

Divider

Divider

Footer

Footer

Form-Error

Form-Error

Form-Field

Form-Field

Header

Header

Header-Action

Header-Action

Icon

Icon

Image

Image

Journey-Header

Journey-Header

Link

Link

Link-List

Link-List

Logo

Logo

Menu

Menu

Menu-Action

Menu-Action

Radio-Button

Radio-Button

Radio-Button-Group

Radio-Button-Group

Selection-Panel

Selection-Panel

Signet

Signet

Slider

Slider

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

Toggle

Toggle

Toggle-Check

Toggle-Check

Tooltip

Tooltip

Tooltip-Trigger

Tooltip-Trigger

Card Implementation

The sbb-card component is a generic content container; its task is to contain content related to a single subject.
There are various sizes (affecting paddings) and colors available.

<sbb-card size="xl" color="milk">
Card content
</sbb-card>

Card With 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 xs or s.

<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>

Card With 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 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>

Accessibility

It's important that a descriptive message is being slotted into the unnamed slot of <sbb-card-action>
as it is used for search engines and screen reader users. E.g. <sbb-card-action>Buy a half-fare ticket now</sbb-card-action>.

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 windows high contrast mode (setting LinkText or ButtonText).

Properties

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

Slots

Slot Description
"badge" Slot to render <sbb-card-badge>.
"unnamed" Slot to render the content.

Dependencies

Used by

Graph

graph TD;
sbb-timetable-row --> sbb-card
style sbb-card fill:#f9f,stroke:#333,stroke-width:4px

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.
White Milk
XS S M L XL XXL
No Yes
No Yes
White Milk Iron Charcoal Black
More examples on Storybook
Imprint Contact Cookie settings