Zur Navigation Zum Inhalt Kontakt Menu Trouver un composant Aperçu Lyne Principes Bases Accessibilité Système de design Guidelines Deutsch Français Italiano English Nos principes de design Centré sur l’utilisateur Reconnaissable Inclusif Minimaliste Holistique Auto-explicatif Axé sur les tâches Approprié Portail de la marque CFF Logo Horloge numérique Droits d’utilisation Couleurs de base Couleurs fonctionnelles Couleurs off-brand Icônes Icônes de l’horaire Pictogrammes À propos de l’accessibilité À propos de ce guide Contact Informations complémentaires Product Owner User Research Interaction Design Visual Design Development Content Design Testing What is a design system? Conception Développer FAQ Aide Procès Contribution Contact Aperçu Base Composants Overview Releases Design Tokens Composants Roadmap Aperçu Base Informations Aperçu Base Composants Sens & objectif Community Assets Instructions Power-Apps Bandeaux publicitaires numériques SAP Icônes d’applications Icon Info

Was macht die Komponente?

Ein Icon ist ein grafisches Symbol, das verwendet wird, um Funktionen, Inhalte oder Aktionen visuell zu repräsentieren und die Benutzererfahrung zu verbessern.

Wann soll die Komponente eingesetzt werden?

  • Um Funktionen oder Aktionen visuell zu unterstützen und hervorzuheben.
  • Um Platz zu sparen und eine intuitive Benutzeroberfläche zu schaffen.
  • Um wichtige Informationen oder Statusmeldungen schnell erkennbar zu machen.
  • Um die Navigation zu unterstützen und die Auffindbarkeit von Inhalten zu verbessern.

Regeln

  • Icons gibt es in 3 Grössen (24 x 24, 36 x 36 und 48 x 48 Pixel). Andere Grössen sind nicht erlaubt.
  • Die Icon werden in einer Strichstärke von 1 Pixel abgebildet. Ausnahmen sind einzig im Header erlaubt.
  • Achte darauf, dass die Grösse der Icons zur umgebenden Schrift und anderen Elementen passt.
  • Verwende Icons sparsam und nur dort, wo sie die Benutzererfahrung tatsächlich verbessern.
  • Biete, wenn möglich, eine Textalternative oder Tooltip an, um die Bedeutung des Icons zu erklären.
Demo

Spielwiese

Icon KOM Icon, small KOM Icon, medium KOM Icon, large Fahrplan Attribut HIM-CUS Icon Produkt Icon Farbe Black Rot Metal Sky White Hintergrund White Milk Iron Charcoal Black
Default
HTML in Zwischenablage kopiert.
Implementation

The sbb-icon component provides a solid way of rendering registered and named icons.

The component will dynamically load an SVG for each icon, avoiding multiple requests to the same icon.
The icon components are not tied to specific icon sets; you can register custom namespaces
and then provide the sbb-icon with the name property in the format name="icon-name" or name="namespace:icon-name".

Note that if you do not provide a namespace, the default namespace will be used pointing to the SBB Icons CDN.

<!-- Will use the default namespace -->
<sbb-icon name="app-icon-medium"></sbb-icon>

If using the SBB CDN, ensure that the icon name has the size suffix.
E.g. if in the Design (Figma) the icon is called 'circle-plus', the icon name will be either 'circle-plus-small' or 'circle-plus-medium'.

Accessibility

Similar to an <img> element, an icon alone does not convey any useful information for a screen-reader user.
The user of sbb-icon must provide additional information pertaining to how the icon is used.
Based on the use-cases described below, sbb-icon is marked as aria-hidden="true" by default,
but this can be overridden by adding aria-hidden="false" to the element.

In thinking about accessibility, it is useful to place icon use into one of three categories:

  1. Decorative: the icon conveys no real semantic meaning and is purely cosmetic.
  2. Interactive: a user will click or otherwise interact with the icon to perform some action.
  3. Indicator: the icon is not interactive, but it conveys some information, such as a status.
    This includes using the icon in place of a text inside a larger message.

Properties

Name Attribute Privacy Type Default Description
name name public string '' The provided name consisting of the namespace and the name of the icon. If the namespace is missing, the default namespace "sbb" will be used. E.g. name (will use "sbb" as namespace) or namespace:name.
noSanitize no-sanitize public boolean false When set to true, SVG content that is HTTP fetched will not be checked if the response SVG content has any <script> elements, or any attributes that start with on, such as onclick.

CSS Properties

Name Default Description
--sbb-icon-svg-height auto Can be used to set a custom height.
--sbb-icon-svg-width auto Can be used to set a custom width.
Trouver un composant

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 Contact Protection des données Paramètres des cookies