Zur Navigation Zum Inhalt Kontakt Menu Trova un componente Descrizione generale Lyne Principi Base Accessibilité Sistema di design Guidelines Deutsch Français Italiano English I nostri principi di design Soluzioni focalizzate sull’utente Riconoscibilità Inclusione Riduzione Olistico Autoesplicativo Orientamento all’attività Adeguatezza Portale della marca FFS Logo Orologio digitale Diritti di utilizzazione Colori die base Colori funzionali Colori Off Brand Icone Icone dell'orario Pittogrammi Informazioni sull’accessibilità Über diesen Guide Contatti Letture consigliate Product Owner User Research Interaction Design Visual Design Development Content Design Testing What is a design system? Designing Coding FAQ Aiuto Processo Contribution Contatto Introduzione Base Componenti Overview Releases Design Tokens Komponenten Roadmap Introduzione Base Informazioni Introduzione Base Componenti Senso & scopo Community Assets Istruzioni Power-Apps Banner pubblicitari digitali SAP Icone delle app Notification Info

Was macht die Komponente?

Eine Notification ist eine Benachrichtigung, die Nutzende über wichtige Informationen, Erfolge, Fehler oder andere Ereignisse in der Anwendung informiert.

Wann soll die Komponente eingesetzt werden?

  • Um Nutzende über den Status von Aktionen zu informieren, z.B. Erfolgs- oder Fehlermeldungen.
  • Um wichtige Systemmeldungen oder Updates anzuzeigen.
  • Um Nutzende auf erforderliche Handlungen oder Änderungen hinzuweisen.

Regeln

  • Notifications sollen klar und prägnant formuliert sein, um die Nachricht schnell zu übermitteln.
  • Biete die Möglichkeit, Notifications manuell zu schliessen oder sie nach einer angemessenen Zeit automatisch verschwinden zu lassen.
  • Verwende konsistente Positionierung der Notifications innerhalb einer Webseite oder Applikation.
Alert Toast
Anatomie
Anatomie der Komponente
Nummer Typ Beschreibung Optional Hinweis
1 Komponente sbb-title Ja
2 Text Beschreibung Nein
3 Komponente sbb-link Ja
4 Komponente sbb-icon Nein Zeigt den entsprechenden Status an.
5 Komponente sbb-secondary-button Ja
Demo

Spielwiese

The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.  Link one
Typ Info Success Warn Error Grössen S M Read only Nein Ja Hintergrund White Milk Iron Charcoal Black
Info
Success
Warn
Error
Readonly
Size S
No Title
Readonly No Title
Slotted Title
Multiple Notifications
HTML in Zwischenablage kopiert.
Implementation

The sbb-notification is a component which purpose is to inform users of updates.
A notification is an element that displays a brief, important message
in a way that attracts the user's attention without interrupting the user's task.

Inline notifications show up in task flows, to notify users of an action status or other information.
They usually appear at the top of the primary content area or close to the item needing attention.

The sbb-notification is structured in the following way:

  • Icon: informs users of the notification type at a glance.
  • Title (optional): gives users a quick overview of the notification.
  • Close button (optional): closes the notification.
  • Message: provides additional detail and/or actionable steps for the user to take.
<sbb-notification>
  The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
  <sbb-link href="/">Link one</sbb-link>
  <sbb-link href="/">Link two</sbb-link>
  <sbb-link href="/">Link three</sbb-link>
</sbb-notification>

Note that the notification only supports inline links.

Variants

The sbb-notification supports four types: info (default), success, warn and error, based on the type of the information displayed.

<sbb-notification type="success">...</sbb-notification>

<sbb-notification type="warn">...</sbb-notification>

<sbb-notification type="error">...</sbb-notification>

States

It is possible to display the component in readonly state by using the self-named property.
In this case, the close button will not be shown.

<sbb-notification readonly> ... </sbb-notification>

Interactions

Inline notifications do not dismiss automatically.
They persist on the page until the user dismisses them or takes action that resolves the notification.

By default, a close button is displayed to dismiss inline notifications. Including the close button is optional
and should not be included if it is critical for a user to read or interact with the notification by setting the readonly property to true.

Style

If the sbb-notification host needs a margin, in order to properly animate it on open/close,
we suggest using the --sbb-notification-margin variable to set it.
For example, use --sbb-notification-margin: 0 0 var(--sbb-spacing-fixed-4x) 0 to apply a bottom margin.

Accessibility

In order to announce the notification's content to screen readers as it becomes visible,
consumers must use the aria-live attribute with the polite value on the component's container.
This ensures that users who rely on screen readers are promptly informed of any relevant updates or changes.

<!-- Add here any incoming notification by adding a sbb-notification component. -->
<div id="notification-container" aria-live="polite">
  <sbb-notification type="success">Task successfully completed.</sbb-notification>
</div>

Animation

Set the animation property to manage which animations are enabled.
As a base rule, opening animations should be active if a notification arrives after the initial page load.

Properties

Name Attribute Privacy Type Default Description
animation animation public 'open' | 'close' | 'all' | 'none' 'all' The enabled animations.
readonly readonly public boolean false Whether the notification is readonly. In readonly mode, there is no dismiss button offered to the user.
size size public 'm' | 's' 'm' Size variant, either s or m.
titleContent title-content public string | undefined Content of title.
titleLevel title-level public SbbTitleLevel '3' Level of title, it will be rendered as heading tag (e.g. h3). Defaults to level 3.
type type public 'info' | 'success' | 'warn' | 'error' 'info' The type of the notification.

Methods

Name Privacy Description Parameters Return Inherited From
close public void

Events

Name Type Description Inherited From
didClose CustomEvent<void> Emits when the closing animation ends.
didOpen CustomEvent<void> Emits when the opening animation ends.
willClose CustomEvent<void> Emits when the closing animation starts.
willOpen CustomEvent<void> Emits when the opening animation starts.

CSS Properties

Name Default Description
--sbb-notification-margin 0 Can be used to modify the margin in order to get a smoother animation. See style section for more information.

Slots

Name Description
Use the unnamed slot to add content to the notification message.
title Use this to provide a notification title (optional).
Trova un componente

Lyne

  • Design Tokens
  • Animation
    Animation
  • Border
    Border
  • Breakpoint
    Breakpoint
  • Color
    Color
  • Layout
    Layout
  • Shadow
    Shadow
  • Size
    Size
  • Spacing
    Spacing
  • Typography
    Typography
  • Action
  • More Info
    Action-Group
  • More Info
    Block-Link
  • More Info
    Button
  • More Info
    Link
  • More Info
    Mini-Button-Group
  • More Info
    Secondary-Button
  • More Info
    Teaser
  • More Info
    Teasser-Hero
  • More Info
    Teaser-Product
  • More Info
    Teaser-Product-Static
  • More Info
    Tertiary-Button
  • More Info
    Transparent-Button
  • Brand
  • More Info
    Clock
  • More Info
    Logo
  • Collection
  • More Info
    Link-List
  • More Info
    Link-List-Anchor
  • More Info
    Skiplink-List
  • More Info
    Table-Wrapper
  • Form
  • More Info
    Autocomplete
  • More Info
    Autocomplete-Grid
  • More Info
    Calendar
  • More Info
    Checkbox
  • More Info
    Checkbox-Group
  • More Info
    Checkbox-Panel
  • More Info
    Datepicker
  • More Info
    File-Selector
  • More Info
    Form-Field
  • More Info
    Radio-Button
  • More Info
    Radio-Button-Group
  • More Info
    Radio-Button-Panel
  • More Info
    Select
  • More Info
    Selection-Expansion-Panel
  • More Info
    Slider
  • More Info
    Toggle
  • More Info
    Toggle-Check
  • Indicator
  • More Info
    Alert
  • More Info
    Alert-Group
  • More Info
    Chip
  • More Info
    Loading-Indicator
  • More Info
    Message
  • More Info
    Notification
  • More Info
    Status
  • More Info
    Stepper
  • More Info
    Tag-Group
  • More Info
    Toast
  • Layout
  • More Info
    Accordion
  • More Info
    Card
  • More Info
    Container
  • More Info
    Divider
  • More Info
    Footer
  • More Info
    Header
  • More Info
    Title
  • Navigation
  • More Info
    Breadcrumb
  • More Info
    Breadcrumb-Group
  • More Info
    Menu
  • More Info
    Navigation
  • More Info
    Tab-Group
  • Overlay
  • More Info
    Dialog
  • More Info
    Overlay
  • More Info
    Popover
  • Time-Table
  • More Info
    Journey-Header
  • More Info
    Pearl-Chain
  • Visual asset
  • More Info
    Icon
  • More Info
    Image
Impressum Contatto Impostazioni dei cookie