sbb-alert-group manages the dismissal and accessibility of alerts and also its visual gap between each other.
<sbb-alert-group accessibility-title='Disruptions' accessibility-level='2'>
title-content='Interruption between Genève and Lausanne'
The rail traffic between Allaman and Morges is interrupted. All trains are cancelled.
<sbb-alert title-content='Interruption between Berne and Olten' href='https://www.sbb.ch'>
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
By specifying the
accessibility-title it's possible to add a hidden title to the
The heading level can be set via
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
aria-live attributes to fit your needs.
For example, you can set the
alert which implicitly sets
and therefore interrupts screen reader flow, to immediately read out the alert content. Note that with role
in some combinations of screen readers and browsers not every part of the alert is fully read.
If all 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.
| || ||Title for this alert group which is only visible for screen reader users.|| || |
| || ||Level of the accessibility title, will be rendered as heading tag (e.g. h2). Defaults to level 2.|| || |
| || ||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.|| || |
| ||Emits when an alert was removed from DOM.|| |
| ||Emits when || |
| ||title for this sbb-alert-group which is only visible for screen reader users.|
| ||content slot, should be filled with |