Zur Navigation Zum Inhalt Kontakt Menu Find component Overview Lyne Principles Foundation Accessibility Design System Guidelines Deutsch Français Italiano English Our design principles User-centred Recognisable Inclusive Reduced Holistic Self-explanatory Task-oriented Appropriate SBB Brand portal Logo Digital clock Rights of use Base colors Functional colors Off brand colors Icons Timetable icons Pictograms About accessibility Über diesen Guide Contact Further information Product Owner User Research Interaction Design Visual Design Development Content Design Testing What is a design system? Designing Coding FAQ Help Process Contribution Contact Overview Base Components Overview Base Components Overview Base Components Overview Design Tokens Components Overview Base Informationen Sense & Purpose Community Assets Instructions Power-Apps Digital banner ads SAP Design Guidelines App Icons
Find component

Lyne

Basics Animation

Animation

Border

Border

Grid

Grid

Spacings

Spacings

Typography

Typography

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

Slider Implementation

The <sbb-slider> is an input component that allows for the selection of a value within a range;
this can be set by consumers using the min and max properties (default values are 0 and 100).

The initial value can be set using the value property (string), or the valueAsNumber (number).
If no value is provided, by default it is set halfway between the minimum and maximum.

The component can optionally display two <sbb-icon>s at either end;
consumers could set one/both of them using the startIcon and endIcon properties,
or can provide their own using the two slots named prefix and suffix.

It is possible to display the component in disabled or readonly state by using the self-named properties.

Consumers can listen to the native change event on the sbb-slider component to intercept the input's change event;
the current value can be read from event.target.value or event.target.valueAsNumber.

The component can be used within a <sbb-form-field> component.

Usage

Simple slider with default range and icons:

<sbb-slider value="40" start-icon="circle-minus-small" end-icon="circle-plus-small"></sbb-slider>

Slider with no icons and custom range:

<sbb-slider max="5" min="1" value="5"></sbb-slider>

Slider inside a <sbb-form-field>:

<sbb-form-field label="Slider">
<sbb-slider value="0"></sbb-slider>
</sbb-form-field>

Accessibility

The <sbb-slider> has the following behaviour on keypress when focused:

Key Action
Right arrow Increment the slider value by one (or one step).
Up arrow Increment the slider value by one (or one step).
Left arrow Decrement the slider value by one (or one step).
Down arrow Decrement the slider value by one (or one step).
Page up Increment the slider value by ten (or ten steps).
Page down Decrement the slider value by ten (or ten steps).
End Set the value to the maximum.
Home Set the value to the minimum.

Properties

Property Attribute Description Type Default
disabled disabled Disabled state for the inner HTMLInputElement. boolean false
endIcon end-icon Name of the icon at component's end, which will be forward to the nested sbb-icon. string undefined
form form The
element to associate the inner HTMLInputElement with.
string undefined
max max Maximum acceptable value for the inner HTMLInputElement. string '100'
min min Minimum acceptable value for the inner HTMLInputElement. string '0'
name name Name of the inner HTMLInputElement. string ''
readonly readonly Readonly state for the inner HTMLInputElement. Since the input range does not allow this attribute, it will be merged with the disabled one. boolean false
startIcon start-icon Name of the icon at component's start, which will be forward to the nested sbb-icon. string undefined
value value Value for the inner HTMLInputElement. string ''
valueAsNumber value-as-number Numeric value for the inner HTMLInputElement. number undefined

Events

Event Description Type
didChange [DEPRECATED] only used for React. Will probably be removed once React 19 is available.

CustomEvent<any>

Slots

Slot Description
"prefix" Slot to render an icon on the left side of the input.
"suffix" Slot to render an icon on the right side of the input.

Dependencies

Depends on

Graph

graph TD;
sbb-slider --> sbb-icon
style sbb-slider fill:#f9f,stroke:#333,stroke-width:4px

Demo
No Yes
Yes No
Yes No
White Milk Iron Charcoal Black
More examples on Storybook
Imprint Contact Cookie settings