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 Additional 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 Releases Design Tokens Components Overview Base Informations Overview Base Components Overview App Icons Power-Apps Digital banner ads SAP Design Guidelines AI Design: Basics Carousel Info

What does the component do?

A carousel is an interactive element for displaying multiple pieces of content within a limited area. It displays one or more pieces of content at a time and allows horizontal scrolling using navigation elements or gestures.

When should the component be used?

  • When several similar pieces of content are to be displayed, but there is not enough space for all of them at once.
  • When the focus is on a visual or content sequence (e.g., highlights, campaigns, products).
  • When space is limited and content needs to be presented in a space-saving manner.

Rules

  • No more than 7 slides should be used.
  • Each slide should have a clear focus.
  • Carousels should not change automatically—only manual control by the user.
Carousel-List
Anatomy

Anatomy of the component


Number Type Description Optional Info
1 Slot Beliebiger Inhalt erlaubt No
2 Component sbb-card-badge Yes
Demo

Playground

Slide 1

Start

Slilde 2

Another button

Slide 3

Shadow Yes No Mode (System Setting) Light Dark Background White Midnight Milk Charcoal Cloud Iron Midnight White Charcoal Milk Iron Cloud
Native
Native Mobile
Sbb Image
Figure
Link
Button
Image And Text
No Shadow
Copy HTML to clipboard.
Implementation

The sbb-carousel is a slideshow component that can be used to display a series of items, as images, once at a time,
allowing users to cycle through them via horizontal scrolling or using controls (e.g. a paginator).

The component must be used together with a sbb-compact-paginator and a sbb-carousel-list,
which accepts one or more sbb-carousel-item.

<sbb-carousel>
  <sbb-carousel-list>
    <sbb-carousel-item>
      <img src="../img-1.jpg" alt="Image 1" height="300" width="400" />
    </sbb-carousel-item>
    <sbb-carousel-item>
      <img src="../img-2.jpg" alt="Image 2" height="300" width="400" />
    </sbb-carousel-item>
    <sbb-carousel-item>
      <img src="../img-3.jpg" alt="Image 3" height="300" width="400" />
    </sbb-carousel-item>
  </sbb-carousel-list>
  <sbb-compact-paginator></sbb-compact-paginator>
</sbb-carousel>

Slots

The content is projected in an unnamed slot.

The length and the pageSize properties of the sbb-compact-paginator are automatically set based on the number of slotted images.

The values of the accessibilityPageLabel, accessibilityPreviousPageLabel and accessibilityNextPageLabel properties
are also set, in order to automatically override the 'page' keyword to the 'slide' one.
If needed, consumers can provide their own values.

Interactions

It's possible to switch between items using the paginator controls, or, if the component is focused, using the arrow keys.

Keyboard Action
Down Arrow / Right Arrow Navigate to the next item.
Up Arrow / Left Arrow Navigate to the previous item.

Accessibility

Following the ARIA carousel pattern,
the component has role="region" and aria-label="carousel".

To not break the accessibility when links are used together with images, please place the image within the anchor tag.

<sbb-carousel>
  <sbb-carousel-list>
    <sbb-carousel-item>
      <a href="#" target="_blank">
        <img src="../img-1.jpg" alt="SBB image" height="300" width="400" />
      </a>
    </sbb-carousel-item>
    ...
</sbb-carousel>

Properties

Name Attribute Privacy Type Default Description
shadow shadow public boolean false Used to display a box-shadow around the component.

Slots

Name Description
Use the unnamed slot to add the sbb-carousel-list for content and a sbb-paginator for controls.