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 supplémentaires 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 Aperçu Releases Design Tokens Composants Aperçu Base Informations Aperçu Base Composants Aperçu Power-Apps Bandeaux publicitaires numériques SAP IA Design : Bases Icônes d’applications Cette page n'est pas disponible dans la langue souhaitée. Langues disponibles: Deutsch English Carousel-Item Info

Was macht die Komponente?

Sie ist Teil der Carousel-List-Komponente.

Wann soll die Komponente eingesetzt werden?

  • Nur innerhalb der Carousel-List-Komponente.
Carousel-List
Demo Native
Sbb Image
HTML in Zwischenablage kopiert.
Implementation

The sbb-carousel-item represents a single item within a sbb-carousel;
it is meant to be slotted in a sbb-carousel-list.

<sbb-carousel-item>
  <img src="../image.jpg" alt="SBB image" height="300" width="400" />
</sbb-carousel-item>

<sbb-carousel-item>
  <sbb-image
    image-src="../image.jpg"
    alt="SBB image"
    style="width: 800px; height: 600px;"
  ></sbb-image>
</sbb-carousel-item>

<sbb-carousel-item>
  <div class="sbb-image">
    <img src="../image.jpg" alt="SBB image" height="300" width="400" />
    <figcaption>Caption for picture</figcaption>
  </div>
</sbb-carousel-item>

Slots

The content is projected in an unnamed slot.

The component supports native img tags, sbb-image, picture and also custom content, appropriately formatted;
since it doesn't have a fixed size, it's important for consumers to define the dimensions of slotted images to correctly render the component.

Events

The component provides two events, named beforeshow and show; their emission is related to scroll events in the sbb-carousel-list.

Accessibility

Following the ARIA carousel pattern,
the component has role="group" and aria-roledescription="slide".
If the aria-label attribute is not provided, it is set by the sbb-carousel-list with a default text.

Events

Name Type Description Inherited From
beforeshow CustomEvent<SbbCarouselItemEventDetail> Event emitted when the item is starting scrolling.
show CustomEvent<SbbCarouselItemEventDetail> Event emitted when the item is full visible after scrolling.

Slots

Name Description
Use the unnamed slot to add images for the carousel, as , , , ...