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 Aperçu Base Composants Aperçu Base Composants Aperçu Design Tokens Composants Aperçu Base Informations Sens & objectif Community Assets Instructions Power-Apps Bandeaux publicitaires numériques SAP Icônes d’applications
Trouver un composant

Lyne

Basics Animation

Animation

Border

Border

Grid

Grid

Spacings

Spacings

Typografie

Typografie

Components Action-Group

Action-Group

Alert

Alert

Alert-Group

Alert-Group

Autocomplete

Autocomplete

Button

Button

Calendar

Calendar

Card

Card

Card-Badge

Card-Badge

Checkbox

Checkbox

Checkbox-Group

Checkbox-Group

Chip

Chip

Clock

Clock

Datepicker

Datepicker

Dialog

Dialog

Divider

Divider

Footer

Footer

Form-Error

Form-Error

Form-Field

Form-Field

Header

Header

Header-Action

Header-Action

Icon

Icon

Image

Image

Journey-Header

Journey-Header

Link

Link

Link-List

Link-List

Logo

Logo

Menu

Menu

Menu-Action

Menu-Action

Radio-Button

Radio-Button

Radio-Button-Group

Radio-Button-Group

Selection-Panel

Selection-Panel

Signet

Signet

Slider

Slider

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

Toggle

Toggle

Toggle-Check

Toggle-Check

Tooltip

Tooltip

Tooltip-Trigger

Tooltip-Trigger

Cette page n'est pas disponible dans la langue souhaitée. Langues disponibles: Deutsch English

Tooltip-Trigger Implementation

The sbb-tooltip-trigger component is used to trigger a tooltip by pressing a button.
By default, it renders the sbb-icon information-circle-small; with the property icon-name it is possible to define a custom icon.
Moreover, it is possible to override the sbb-icon with custom content by slotting it.

Usage

The examples below shows how to use the component with the <sbb-icon> and custom content.

Tooltip trigger with sbb-icon

 <sbb-tooltip-trigger id="tooltip-trigger"></sbb-tooltip-trigger>

<sbb-tooltip trigger="tooltip-trigger">
<p>
Tooltip content.
</p>
</sbb-tooltip>

Tooltip trigger with custom content

<sbb-tooltip-trigger id="tooltip-trigger2">
Custom Content
</sbb-tooltip-trigger>

<sbb-tooltip trigger="tooltip-trigger2">
<p>
Tooltip content.
</p>
</sbb-tooltip>

Accessibility

In order to make screen readers announce the type of the trigger when is focused, use the aria-label attribute, as shown below:

<sbb-tooltip-trigger aria-label="Custom label" id="tooltip-trigger">
</sbb-tooltip-trigger>

To make screen readers announce the tooltip content when the trigger is focused,
associate the tooltip trigger with the tooltip via aria-describedby and an id.

<sbb-tooltip-trigger aria-describedby="tooltip-content" id="tooltip-trigger"></sbb-tooltip-trigger>

<!-- Tooltip component -->
<sbb-tooltip id="tooltip" trigger="tooltip-trigger">
<p id="tooltip-content">
Tooltip content. <sbb-link id="tooltip-link" variant="inline">Link</sbb-link>
</p>
</sbb-tooltip>

Properties

Property Attribute Description Type Default
disabled disabled Whether the tooltip-trigger is disabled. boolean false
iconName icon-name The icon name we want to use, choose from the small icon variants from the ui-icons category from here https://icons.app.sbb.ch. string 'circle-information-small'
name name The name attribute to use for the button. string undefined

Slots

Slot Description
"unnamed" Slot to render the content.

Dependencies

Used by

Depends on

Graph

graph TD;
sbb-tooltip-trigger --> sbb-icon
sbb-datepicker-toggle --> sbb-tooltip-trigger
style sbb-tooltip-trigger fill:#f9f,stroke:#333,stroke-width:4px

Demo
Tooltip content.
Default Anderes
Nein Ja
White Milk Iron Charcoal Black
Mehr Beispiele auf Storybook
Impressum Contact Paramètres des cookies