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

Link Implementation

The sbb-link component provides the same functionality as a native <a> enhanced with the SBB Design.

Slots

The link text is provided via an unnamed slot; the component can optionally display a sbb-icon using
the iconName property or via custom content using the icon slot.
By default, the icon is placed at the component's end, but this can be changed using the iconPlacement property.

<sbb-link href="https://www.sbb.ch" icon-name="chevron-small-right-small"> Help </sbb-link>

<sbb-link href="https://www.sbb.ch" icon-name="chevron-small-left-small" icon-placement="start">
Contact
</sbb-link>

States

The component can be displayed in disabled state using the self-named property.

<sbb-link disabled>Refunds</sbb-link>

Link / button properties

The component can be internally rendered as a button or as a link,
depending on the value of the href property, so the associated properties are available
(href, target, rel and download for link; type, name, value and form for button).
If isStatic is set, the component will be rendered as a link without any user interaction.
Please note that if the sbb-link is placed inside another anchor or button tag,
it is internally rendered as a span in order to not break HTML functionality.

<sbb-link href="https://github.com/lyne-design-system/lyne-components" target="_blank">
Travel-cards and tickets
</sbb-link>

<sbb-link type="button" name="tickets" form="buy" value="tickets">
Travel-cards and tickets
</sbb-link>

Style

The component has two variants (block, which is the default, and inline), that can be set using the variant property,
and it has also three sizes (xs, s, which is the default, and m) that are relevant only in variant='block'.

<sbb-link size="m">Refunds</sbb-link>

<p>
Some informative text.
<sbb-link variant="inline" href="#info">Show more.</sbb-link>
</p>

Properties

Name Attribute Privacy Type Default Description
variant variant public 'block' | 'inline' 'block' Variant of the link (block or inline).
negative negative public boolean false Negative coloring variant flag.
size size public SbbLinkSize 's' Text size, the link should get in the non-button variation. With inline variant, the text size adapts to where it is used.
isStatic is-static public boolean false Set this property to true if you want only a visual representation of a link, but no interaction (a span instead of a link/button will be rendered).
iconName icon-name public string | undefined 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. Inline variant doesn't support icons.
iconPlacement icon-placement public SbbIconPlacement | undefined 'start' Moves the icon to the end of the component if set to true.
href href public string | undefined The href value you want to link to (if it is not present link becomes a button).
target target public LinkTargetType | string | undefined | undefined Where to display the linked URL.
rel rel public string | undefined | undefined The relationship of the linked URL as space-separated link types.
download download public boolean | undefined Whether the browser will show the download dialog on click.
type type public ButtonType | undefined The type attribute to use for the button.
disabled disabled public boolean false Whether the button is disabled.
name name public string | undefined The name attribute to use for the button.
value value public string | undefined The value attribute to use for the button.
form form public string | undefined The
element to associate the button with.

Slots

Name Description
Use the unnamed slot to add content to the sbb-link.
icon Slot used to display the icon, if one is set.
Demo
I am a link
Varianten Block Inline Grössen XS S M Icon Ja Nein Icon Position Am Anfang Am Ende Negativ Nein Ja Hintergrund White Milk Iron Charcoal Black Mehr Beispiele auf Storybook
Impressum Contact Paramètres des cookies