Der Loading-Indicator zeigt, dass im Hintergrund eine Aktion läuft und Nutzende warten müssen. Er ist für den Einsatz als Overlay gedacht und in Rot, Smoke und Weiss verfügbar.
aria-live platziert und erhält ein aria-label.
Die Web Component ist im Paket @sbb-esta/lyne-elements enthalten.
The <sbb-loading-indicator> is a component which can be used to indicate progress status
or an ongoing activity which require some time to complete.
We recommend using the loading indicator only for actions that are expected to take at least one second.
For shorter processes, the indicator may appear as a distracting flash.
The loading indicator should generally be displayed after one second has elapsed since an action has started.
If it is known in advance that the back-end service will take at least one second to respond,
the loading indicator may be displayed immediately.
A minimum display duration of about 500ms can help prevent the indicator from disappearing too quickly,
but is not required and depends on what happens next.
For longer waiting times, especially those of around 10 seconds or more,
consider providing a progress indicator to give users an indication of the remaining time.
It's possible to define the size of the component, choosing between s (default), l, xl, xxl, and xxxl.
<sbb-loading-indicator size="l"></sbb-loading-indicator>
If the <sbb-loading-indicator> should be announced by screen-readers, use an element with the correct aria attributes
(aria-live set to polite or assertive, and possibly aria-atomic and aria-relevant)
and then append the <sbb-loading-indicator> on it after giving it the correct aria-label.
<div class="loader-container" aria-live="polite">
<sbb-loading-indicator size="l" aria-label="Loading, please wait"></sbb-loading-indicator>
</div>
Diese Komponente gibt es auch für Angular im Paket @sbb-esta/lyne-angular.
SbbLoadingIndicatorElement, sbb-loading-indicator.| Name | Attribute | Privacy | Type | Default | Description |
|---|---|---|---|---|---|
color | color | public | 'default' | 'smoke' | 'white' | 'default' | Color variant. |
size | size | public | 's' | 'l' | 'xl' | 'xxl' | 'xxxl' | 's' | Size variant, either s or m. |