Zur Navigation Zum Inhalt Kontakt Menu Komponente finden Übersicht Lyne 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 Funktionale 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 Basis Komponenten Übersicht Basis Komponenten Übersicht Releases Design Tokens Komponenten Übersicht Basis Informationen Sinn & Zweck Community Assets Anleitung Power-Apps Digitale Werbebanner SAP App Icons
Komponente finden

Lyne

Basics Animation Animation Border Border Grid Grid Spacings Spacings Typografie Typografie Components Accordion Accordion Action-Group Action-Group Alert Alert Alert-Group Alert-Group Autocomplete Autocomplete Breadcrumb Breadcrumb Breadcrumb-Group Breadcrumb-Group Button Button Calendar Calendar Card Card Card-Action Card-Action Card-Badge Card-Badge Checkbox Checkbox Checkbox-Group Checkbox-Group Chip Chip Clock Clock Container Container Datepicker Datepicker Dialog Dialog Divider Divider Expansion-Panel Expansion-Panel File-Selector File-Selector Footer Footer Form-Error Form-Error Form-Field Form-Field Form-Field-Clear Form-Field-Clear Header Header Header-Action Header-Action Icon Icon Image Image Journey-Header Journey-Header Link Link Link-List Link-List Loading-Indicator Loading-Indicator Logo Logo Menu Menu Menu-Action Menu-Action Message Message Navigation Navigation Navigation-Action Navigation-Action Navigation-List Navigation-List Navigation-Marker Navigation-Marker Navigation-Section Navigation-Section Notification Notification Popover Popover Popover-Trigger Popover-Trigger Radio-Button Radio-Button Radio-Button-Group Radio-Button-Group Select Select Selection-Panel Selection-Panel Signet Signet Skiplink-List Skiplink-List Slider Slider Status Status Sticky-Bar Sticky-Bar 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 Toast Toast Toggle Toggle Toggle-Check Toggle-Check
Alert Implementation

The sbb-alert is a component which should be used to display important messages to a client.

Multiple instances of this component can be used within
the sbb-alert-group component.

Slots

The text content is projected using and unnamed slot, while the title uses the slot named title or alternatively the titleContent property.
The component can optionally display a sbb-icon at the component start using the iconName property or via custom content using the icon slot.

<sbb-alert title-content="Interruption between Berne and Olten" icon-name="disruption">
  Between Bern 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-alert>

<sbb-alert>
  <span slot="title">Interruption between Berne and Olten</span>
  <sbb-icon slot="icon" name="disruption"></sbb-icon>
  Between Bern 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-alert>

Interactions

It's possible to place an action, which by clicking navigates somewhere to display more information.
This can be done using the linkContent property combined with the href one.
The target and rel property are also configurable via the self-named properties.

<sbb-alert
  title-content="Interruption"
  link-content="Show more"
  href="https://www.sbb.ch"
  target="_blank"
>
  ...
</sbb-alert>

The sbb-alert can optionally be hidden by a user, if the readonly prop is not set.
Please note that clicking on the close button does not remove it from the DOM, this would be the responsibility
of the library consumer to do it by reacting to the specific event.
See also the sbb-alert-group
which automatically removes an alert after clicking the close button.

<sbb-alert title-content="Interruption between Berne and Olten" readonly>
  Between Bern 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-alert>

Style

Users can choose between two size, m (default) and l.

<sbb-alert size="l"> ... </sbb-alert>

Accessibility

Accessibility is mainly done by wrapping the alerts into the sbb-alert-group.

The description text is wrapped into an <p> element to guarantee the semantic meaning.

Avoid slotting block elements (e.g. <div>) as this violates semantic rules and can have negative effects on screen readers.

Properties

Name Attribute Privacy Type Default Description
readonly readonly public boolean false Whether the alert is readonly. In readonly mode, there is no dismiss button offered to the user.
size size public 'm' | 'l' 'm' You can choose between m or l size.
disableAnimation disable-animation public boolean false Whether the fade in animation should be disabled.
iconName icon-name public string | undefined Name of the icon which will be forward to the nested sbb-icon. Choose the icons from https://icons.app.sbb.ch. Styling is optimized for icons of type HIM-CUS.
titleContent title-content public string | undefined Content of title.
titleLevel title-level public TitleLevel '3' Level of title, will be rendered as heading tag (e.g. h3). Defaults to level 3.
linkContent link-content public string | undefined Content of the link.
href href public string | undefined The href value you want to link to.
target target public LinkTargetType | string | undefined Where to display the linked URL.
rel rel public string | undefined The relationship of the linked URL as space-separated link types.
accessibilityLabel accessibility-label public string | undefined This will be forwarded as aria-label to the relevant nested element.

Methods

Name Privacy Description Parameters Return Inherited From
requestDismissal public Requests dismissal of the alert. void

Events

Name Type Description Inherited From
willOpen CustomEvent<void> Emits when the fade in animation starts.
didOpen CustomEvent<void> Emits when the fade in animation ends and the button is displayed.
dismissalRequested CustomEvent<void> Emits when dismissal of an alert was requested.

Slots

Name Description
Use the unnamed slot to add content to the sbb-alert.
icon Should be a sbb-icon which is displayed next to the title. Styling is optimized for icons of type HIM-CUS.
title Title content.
Demo
Between Bern 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.
Grössen M L Read only Nein Ja Link Ja Nein Hintergrund White Milk Iron Charcoal Black
Beispiele Default Alert
Size L
Without Close Button
With Disabled Animation
Without Link
With Custom Link Text
Icon And Title As Slot
HTML-Markup kopiert.
Impressum Kontakt Cookie Einstellungen