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 Zusätzliche 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 Releases Design Tokens Komponenten Übersicht Basis Informationen Übersicht Basis Komponenten Übersicht Power-Apps Digitale Werbebanner SAP AI Design: Grundlagen App Icons Alert-Group Info

Was macht die Komponente?

Sie gewährleistet das Layout und die Animation der Alert-Komponente wenn eine- oder mehrere Alert-Komponente eignesetzt werden.

Wann soll die Komponente eingesetzt werden?

  • Nur in Kombination mit der Alert-Komponente.
Notification Alert
Anatomie

Anatomie der Komponente


Nummer Typ Beschreibung Optional Hinweis
1 Komponente sbb-icon Nein
2 Komponente sbb-title Nein
3 Text Nein
4 Komponente sbb-link Ja
5 Komponente sbb-divider - Erscheint bei readonly="false"
6 Komponente sbb-transparent-button - Erscheint bei readonly="false"
Demo Multiple Alerts
HTML in Zwischenablage kopiert.
Implementation

The sbb-alert-group manages the accessibility of one or multiple
sbb-alert and also its visual gap between each other.

<sbb-alert-group accessibility-title="Disruptions" accessibility-level="2">
  <sbb-alert size="l">
    <sbb-title level="3">Interruption between Genève and Lausanne</sbb-title>
    The rail traffic between Allaman and Morges is interrupted. All trains are cancelled.
    <sbb-link href="https://www.sbb.ch">Find out more</sbb-link>
  </sbb-alert>
  <sbb-alert>
    <sbb-title level="3">Interruption between Berne and Olten</sbb-title>
    Between Berne and Olten from 03.11.2021 to 05.12.2022 each time from 22:30 to 06:00 o'clock
    construction work will take place. You have to expect changed travel times and changed
    connections. <sbb-link href="https://www.sbb.ch">Find out more</sbb-link>
  </sbb-alert>
</sbb-alert-group>

Interactions

If all the sbb-alerts are dismissed, it's recommended to completely remove the sbb-alert-group from DOM.

You can catch this moment by listening to empty event and react accordingly.

Accessibility

By specifying the accessibility-title it's possible to add a hidden title to the sbb-alert-group.
The heading level can be set via accessibility-title-level.

By default, the sbb-alert-group has the role status which means that if a new alert arrives,
it will be read out as soon as the user is idle
(equal to aria-live="polite").

You can change the role or aria-live attributes to fit your needs.
For example, you can set the role to alert which implicitly sets aria-live to assertive
and therefore interrupts screen reader flow, to immediately read out the alert content.

Note that with role alert, in some combinations of screen readers and browsers not every part of the alert is fully read.

Properties

Name Attribute Privacy Type Default Description
accessibilityTitle accessibility-title public string '' Title for this alert group which is only visible for screen reader users.
accessibilityTitleLevel accessibility-title-level public SbbTitleLevel '2' Level of the accessibility title, will be rendered as heading tag (e.g. h2). Defaults to level 2.
role role public 'alert' | 'status' | string 'status' The role attribute defines how to announce alerts to the user. 'status': sets aria-live to polite and aria-atomic to true. 'alert': sets aria-live to assertive and aria-atomic to true.

Events

Name Type Description Inherited From
empty Event Emits when sbb-alert-group becomes empty.

Slots

Name Description
Use the unnamed slot to add sbb-alert elements to the sbb-alert-group.
accessibility-title title for this sbb-alert-group which is only visible for screen reader users.