This guideline now covers both SAPUI5 and SAP Web Components. Learn more.
Information
Icon
false

Intro

The slider lets users select a value within a predefined numeric or non-numeric interval by dragging a handle along a track.

Slider with handle on track for selecting a value within a predefined range.

Slider component

Component availability

The component is available in the following libraries:

<div> <div data-valign="middle">Library</div> <div data-valign="middle">Technical Name</div> <div data-valign="middle">Identifier</div> </div> <div> <div data-valign="middle">SAPUI5 Demo Kit</div> <div><a href="https%3A%2F%2Fui5.sap.com%2F%23%2Fentity%2Fsap.m.Slider">sap.m.Slider</a></div> <div data-valign="middle">:badge, info, large, _, SAPUI5:</div> </div> <div> <div data-valign="middle">SAP Web Components</div> <div data-valign="middle"><a href="https%3A%2F%2Fui5.github.io%2Fwebcomponents%2Fcomponents%2FSlider%2F">ui5-slider</a></div> <div data-valign="middle">:badge, info, large, _, SAP Web Components:</div> </div> <div> <div data-valign="middle">SAP Web UI Kit (Figma)</div> <div data-valign="middle"><a href="https%3A%2F%2Fwww.figma.com%2Fdesign%2FSILcWzK5uFghKun9jx6D7c%2FSAP-Web-UI-Kit%3Fnode-id%3D19-2025">Slider</a></div> <div data-valign="middle">:badge, info, large, _, Figma:</div> </div>
<div> <div data-valign="middle">Library</div> <div data-valign="middle">Technical Name</div> <div data-valign="middle">Identifier</div> </div> <div> <div data-valign="middle">SAPUI5 Demo Kit</div> <div><a href="https%3A%2F%2Fui5.sap.com%2F%23%2Fentity%2Fsap.m.Slider">sap.m.Slider</a></div> <div data-valign="middle">:badge, info, large, _, SAPUI5:</div> </div> <div> <div data-valign="middle">SAP Web Components</div> <div data-valign="middle"><a href="https%3A%2F%2Fui5.github.io%2Fwebcomponents%2Fcomponents%2FSlider%2F">ui5-slider</a></div> <div data-valign="middle">:badge, info, large, _, SAP Web Components:</div> </div> <div> <div data-valign="middle">SAP Fiori for Web UI Kit (Figma)</div> <div data-valign="middle"><a href="https%3A%2F%2Fwww.figma.com%2Fcommunity%2Ffile%2F1494295794601744471">Slider</a></div> <div data-valign="middle">:badge, info, large, _, Figma:</div> </div>

When to Use

2
do
false

Use the slider to:

  • Adjust a value along a continuous or gradual range.
  • Handle values that change smoothly, such as volume or brightness.
  • Allow people to make quick adjustments without typing.
  • Provide immediate visual feedback as the handle moves.
dont
false

Don’t use the slider to:

  • Make specific choices, such as selecting a category or an item from a list. Consider using radio buttons or checklists instead.
  • Make selections without full accessibility support. Ensure keyboard interaction, visible value indicators, and clear min and max labels. Alternatively, use dropdowns or input fields.
  • Make selections when space is limited. On small screens, sliders can take up too much room. Consider using smaller input options when the screen is crowded.
  • Always label the slider to indicate what the selected value represents.
  • When using custom sliders, keep labels short and meaningful to maintain a clear, easy-to-read, and visually balanced descriptive scale.
  • Use steps that match the required precision. Smaller steps help users choose more exact values when necessary.
  • If relevant, display the unit of measurement next to or inside the slider or its related input field (for example, %, kg, or °C).
  • Display the current value near the slider or in a connected input field to enhance clarity and ease of use.

Anatomy

  1. Start point: Minimum value of the slider range.
  2. Track (active or inactive): Shows the slider range. The active track extends from the start point to the current value, and the inactive track covers the remainder of the range.
  3. Value indicator (optional): Displays the current value and can switch to an input field for direct editing.
  4. Tick marks (optional): Represent the value steps. Each tick mark corresponds to a selectable value.
  5. End point: Maximum value of the slider range.
  6. Labels (optional): Display the values for selected tick marks along the slider.
  7. Slider handle: Draggable grip used to select a value.

Anatomy of a slider with numbered pointers referencing its different elements: start point, track, value indicator, tick marks, end point, labels, and slider handle.

Anatomy of a slider

Types

Basic slider

Standard slider with a handle and track for selecting a value within a defined range. It includes no additional elements, such as a value indicator or tick marks. Use when the value selection is simple, and no additional visual guidance is required.

Basic slider with handle on a track without tick marks and labels.

Basic slider

Slider without progress bar

A slider without a progress bar is useful when visual emphasis on the current value is not required.

Slider with a handle, without progress bar and without tick marks and labels.

Slider without progress bar

Slider with value indicator

The value indicator appears above the handle to show or edit the current value. Use this option when precise feedback or direct manual entry is required.

A. Value indicator: Displays the current value above the handle.

B. Editable value indicator: Displays the current value above the handle in an input field that users can edit directly.

Two sliders with value indicators above the handles showing current value in display (A) and edit mode (B).

Slider with value Indicator – display and edit mode

Slider with tick marks and labels

Tick marks appear along the track to represent value steps. Labels can be added to selected tick marks to show their values. Use this variant when the range includes predefined or incremental values.

Slider with a handle and tick marks, labels and incremental value steps.

Slider with tick marks and labels

Custom scale and custom value indicators :badge, info, large, _, SAPUI5 only:

The slider supports custom scales and value indicators, allowing descriptive labels instead of numeric values. Labels should be concise and meaningful to ensure clarity and usability. When labels are longer, the number of tick marks should be reduced to prevent visual clutter.

Slider with custom scale using descriptive labels instead of numbers and a custom value indicator above the handle.

Slider with custom scale and value indicator

hint
To use custom scales in a slider, you must map them to the floats for the slider scale.

States

Components change their appearance based on their state, which helps users predict outcomes and understand how to interact with them.

Component states

The slider supports two component states: enabled and disabled.

A. Enabled: The slider is interactive and the user can adjust the value.

B. Disabled: The slider is non-interactive and cannot be adjusted.

For more information, see Component States.

Two sliders in different component states: enabled (A) and disabled (B), where the latter appears faded and non-interactive.

Slider component states

Interaction states

The slider has three interaction states: regular, hover, and down.

A. Regular: The default state for a component.

B. Hover: When the cursor is over the handle, it highlights to indicate it can be adjusted.

C. Down: Shown while the handle is pressed or being dragged.

For more information, see Interaction States.

Three sliders in different interaction states: regular (A), hover (B), and down (C).

Slider interaction states

Focus state

When the handle is focused, it displays a visible border with a transparent fill, so the current value remains visible beneath it.

For more information, see Focus States.

Slider in focus state displaying a visible border on the handle with a transparent fill.

Slider focus state

Behavior and Interaction

Dragging the handle to adjust the value

Users can drag the handle to precisely adjust the value within a defined range. The behavior follows these steps:

A. Default state: The slider is in its default state. The handle is placed either at a default range value (such as 0 and 100) or at a position defined by your application.

B. Clicking the handle: When a user clicks on the handle, it becomes transparent, ensuring that the current value underneath remains visible and easy to track.

C. Dragging the handle: The user can drag the handle along the track to adjust the value. If the value indicator is enabled, it remains visible throughout the interaction and provides real-time feedback by continuously updating as the user moves the handle.

This behavior offers direct manipulation and immediate feedback, making the slider ideal for scenarios where continuous value adjustment is necessary, such as setting a volume level, a percentage, or a specific range.

Three-step sequence demonstrating dragging a handle on a track: default state (A), clicking handle (B), dragging it to adjust the value with real-time feedback (C).

Dragging a handle to adjust a value

Clicking on the track to adjust the value

Users can also adjust a value by interacting directly with the track itself. Clicking the track moves the handle to the clicked position.

A. Start of interaction: The slider is in its default state, with either a predefined value or a value that was previously modified.

B. End of interaction: When a user clicks anywhere on the track, the component instantly repositions the handle to that clicked location. This new position then becomes the slider’s current value, and the component updates accordingly.

This functionality is ideal for scenarios where users need to make quick, approximate selections or large jumps in value, rather than fine-tuned adjustments. For example, a user might click the track to jump from 20% to 80% quickly, then drag the handle for a precise adjustment from 80% to 83%.

Two-step sequence showing clicking on a track: default state (A), handle moves to clicked position (B).

Clicking or tapping the track moves the handle to a new point

Snapping

The snapping mechanism in a slider is based on preconfigured step intervals. When the user drags the handle or clicks the track, the handle snaps to the nearest value according to the configured step interval. This feature helps users make accurate adjustments with ease and confidence, minimizing the likelihood of errors.

A. Start of interaction: As the user drags the handle to a new position, or after they click on the track, the component determines the intended value.

B. End of interaction: When the user releases the handle or after the click is registered, the handle automatically snaps to the nearest tick mark according to the component’s configured step interval. Simultaneously, the value indicator updates accordingly.

This snapping functionality is ideal for scenarios where continuous, free-form value selection is not desired. For example, you might use snapping to select quantities in whole numbers, adjust time intervals in 15-minute increments, or set percentages with specific jumps like 25%, 50%, 75%, and 100%. It reduces user error by only allowing valid selections and provides immediate visual confirmation of the chosen increment.

Two-step sequence demonstrating snapping: dragging handle (A) and releasing it to snap to the nearest tick mark (B) on the track.

Tick marks snapping by handle dragging

Editable value indicator

If the value indicator is editable, it switches to an input field, so the user can type a specific value instead of dragging the handle.

A. Start of interaction: The component allows the user to directly click on the value indicator, which then transforms into an input field. The user types a new value and then presses the Enter key to confirm their input.

B. End of interaction: The handle moves to its new position, and the value indicator updates accordingly.

This functionality provides flexibility. It’s ideal for scenarios where numeric precision is crucial, or when users find typing more efficient than visual adjustment.

Two-step sequence demonstrating editable value indicators: click to transform the value indicator to an input field, enter a new value (A) and confirm (hit Enter) to move the handle (B) to its new position.

Editing a value using the value indicator

Responsiveness

By default, the slider takes the width of its parent container. It supports both cozy and compact form factors.

Tick marks and labels

When space becomes limited, the slider hides labels and tick marks to prevent overlap. The first and last labels always remain visible.

A. Original size: All tick marks and labels are visible.

B. Reduced size: Some tick marks and labels are visible.

C. Further reduced size: Only a few tick marks and labels remain visible.

Tick marks and labels hidden progressively as space decreases

Three different sliders in different sizes showing all tick marks and labels (A), some tick marks (B) and only the start and end points (C) on the track to demonstrate how tick marks and labels get hidden to prevent overlap.

Accessibility

SAP follows international standards, such as WCAG and WAI-ARIA, and strives to make our business solutions accessible and inclusive.

For more information, see Accessibility in SAP Fiori and the Accessibility Design Tools Handbook.

Keyboard navigation

The following keyboard combinations are supported by the SAPUI5 Slider component.

<div> <div>Key Combination</div> <div>What It Does</div> </div> <div> <div><strong>Tab</strong></div> <div>Moves the focus to the handle.</div> </div> <div> <div><strong>Shift + Tab</strong></div> <div>Backward navigation.</div> </div> <div> <div><strong>Right Arrow or Up Arrow / +</strong></div> <div>If the focus is the handle, its value is increased by one unit.</div> </div> <div> <div><strong>Left Arrow or Down Arrow / -</strong></div> <div>If the focus is on the handle, its value is decreased by one unit.</div> </div> <div> <div><strong>Ctrl + Right Arrow or Ctrl + Up Arrow or Page Up</strong></div> <div>Increases the value of the slider by a large increment. The handle moves to the right.</div> </div> <div> <div><strong>Ctrl + Left Arrow or Ctrl + Down Arrow or Page Down</strong></div> <div>Decreases the value of the slider by a large increment. The handle moves to the left.</div> </div> <div> <div><strong>Home</strong></div> <div>Sets the minimum value. The handle moves to the minimum position.</div> </div> <div> <div><strong>End</strong></div> <div>Sets the maximum value. The handle moves to the maximum position.</div> </div> <div> <div><strong>Esc</strong></div> <div>Sets the handle back to the value which it had when it got the focus.</div> </div> <div> <div><strong>F2</strong></div> <div>Accesses the editable value indicator of the focused handle. The user can type the value they want to set.</div> </div>

Screen reader support

For details on screen reader support and Accessible Rich Internet Applications (ARIA), see the UI5 Screen Reader Support and WAI-ARIA Authoring.

Content

Wrapping and truncation

If the content exceeds the container width, it will be truncated automatically. Define an appropriate label width to maintain clarity and avoid unnecessary truncation.

Slider showing a truncated label when its content exceeds available width.

Slider with truncating labels

Localization

The slider supports both left-to-right and right-to-left layouts. In right-to-left mode, the track direction and handle movement mirror the reading flow.

Slider in left-to-right (LTR) layout with values increasing from left to right.

Slider in left-to-right mode

Slider in right-to-left (RTL) layout with values increasing from right to left.

Slider in right-to-left mode

Framework Comparison

Some behaviors differ between frameworks due to implementation specifics. The table below summarizes the differences between SAPUI5 and SAP Web Components and lists the framework-specific patterns.

<div> <div>Feature</div> <div>SAPUI5</div> <div>SAP Web Components</div> </div> <div> <div>The slider supports custom scale and value indicators, enabling the use of descriptive labels in place of numeric values. For more information, see <a href="https%3A%2F%2Fwww.sap.com%2Fdesign-system%2Ffiori-design-web%2Fui-elements%2Fslider%2Fusage%23custom-scale-and-custom-value-indicators">Custom scale and custom value indicators</a>.</div> <div>Available</div> <div>Not available</div> </div>

[internal_only]To request this feature for SAP Web Components, submit an InnerSource request.[/internal_only]

Guidelines

Components

Range Slider
Input Field

Implementation

SAPUI5

Slider(samples)
Slider (API reference)

SAP Web Components

Slider

Specifications

Slider (visual design)

SAP Web UI Kit

Slider

Guidelines

Components

Range Slider
Input Field

Implementation

SAPUI5

Slider (samples)
Slider (API reference)

UI5 Web Components

Slider

UI Kit (Figma)

SAP Fiori for Web UI Kit / Slider