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 Introduzione Base Componenti Introduzione Base Componenti Introduzione Design Tokens Componenti Introduzione Base Informazioni Senso & scopo Community Assets Istruzioni Power-Apps Banner pubblicitari digitali SAP Icone delle app
Trova un componente

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

Questa pagina non è disponibile nella lingua desiderata. Lingue disponibili: Deutsch English

Button Implementation

If the href property is set, it will internally be rendered as link, otherwise as a button.
If the <sbb-button> is placed inside another action element (e.g. button, link, ...),
it is internally rendered as a <span> in order to not break HTML structure.
It's also possible to set the <sbb-button> manually into static state by applying is-static property.
If the <sbb-button> is placed inside an <sbb-form-field>, it renders with the correct styling.

Usage

Simple button

<sbb-button>Button text</sbb-button>

Button with icon

<sbb-button icon-name="info">Button text</sbb-button>

Button with slotted icon

<sbb-button>
<sbb-icon slot="icon" name="info"></sbb-icon>
Button text
</sbb-button>

Accessibility

Use the accessibility properties in case of an icon only button to describe the purpose of the button for screen reader users.

Focus outline

Please make sure, that the focus outline appears in the correct color if using on a dark background.
You can set it by re-defining the css var on sbb-button or any parent element:

sbb-button {
--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);
}

Properties

Property Attribute Description Type Default
disabled disabled Whether the button is disabled. boolean false
download download Whether the browser will show the download dialog on click. boolean undefined
form form The
element to associate the button with.
string undefined
href href The href value you want to link to (if it is present, button becomes a link). string undefined
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 undefined
isStatic is-static Set this property to true if you want only a visual representation of a button, but no interaction (a span instead of a link/button will be rendered). boolean false
name name The name attribute to use for the button. string undefined
negative negative Negative coloring variant flag. boolean false
rel rel The relationship of the linked URL as space-separated link types. string undefined
size size Size variant, either l or m. "l" | "m" 'l'
target target Where to display the linked URL. string undefined
type type The type attribute to use for the button. "button" | "reset" | "submit" undefined
value value The value attribute to use for the button. string undefined
variant variant Variant of the button, like primary, secondary etc. "primary" | "secondary" | "tertiary" | "transparent" 'primary'

Slots

Slot Description
"icon" Slot used to display the icon, if one is set
"unnamed" Button Content

Dependencies

Used by

Depends on

Graph

graph TD;
sbb-button --> sbb-icon
sbb-alert --> sbb-button
sbb-calendar --> sbb-button
sbb-dialog --> sbb-button
sbb-map-container --> sbb-button
sbb-navigation --> sbb-button
sbb-navigation-section --> sbb-button
sbb-notification --> sbb-button
sbb-toast --> sbb-button
sbb-tooltip --> sbb-button
style sbb-button fill:#f9f,stroke:#333,stroke-width:4px

Demo
Label
Primary Secondary Tertiary Transparent
M L
Ja Nein
Ja Nein
Nein Ja
White Milk Iron Charcoal Black
Mehr Beispiele auf Storybook
Impressum Contatto Impostazioni dei cookie