Range Slider

v1.0.0-rc.11
@ui5/webcomponents
<ui5-range-slider>

Basic Range Slider

<ui5-range-slider end-value="20"></ui5-range-slider>
	

Range Slider with Custom 'min', 'max', 'startValue' and 'endValue' Properties

<ui5-range-slider  min="100" max="200" start-value="120" end-value="150"></ui5-range-slider>
	

Range Slider with Tooltips

<ui5-range-slider start-value="3" end-value="13" show-tooltip></ui5-range-slider>
	

Range Slider with Tickmarks and Custom Step

<ui5-range-slider step="2" start-value="4" end-value="12" show-tickmarks></ui5-range-slider>
	

Range Slider with Tooltips, Tickmarks and Labels

<ui5-range-slider min="0" max="112" step="2" start-value="4" end-value="12" show-tooltip label-interval="2" show-tickmarks></ui5-range-slider>
	

Overview

Represents a numerical interval and two handles (grips) to select a sub-range within it. The purpose of the component to enable visual selection of sub-ranges within a given interval.

Structure

The most important properties of the Range Slider are:
  • min - The minimum value of the slider range.
  • max - The maximum value of the slider range.
  • value - The current value of the slider.
  • step - Determines the increments in which the slider will move.
  • showTooltip - Determines if a tooltip should be displayed above the handle.
  • showTickmarks - Displays a visual divider between the step values.
  • labelInterval - Labels some or all of the tickmarks with their values.

Notes:

  • The right and left handle can be moved individually and their positions could therefore switch.
  • The entire range can be moved along the interval.

Usage

The most common use case is to select and move sub-ranges on a continuous numerical scale.

Responsive Behavior

You can move the currently selected range by clicking on it and dragging it along the interval.

Keyboard Handling

  • Left or Down Arrow - Moves a component's handle or the entire selection one step to the left;
  • Right or Up Arrow - Moves a component's handle or the entire selection one step to the right;
  • Left or Down Arrow + Ctrl/Cmd - Moves a component's handle to the left or the entire range with step equal to 1/10th of the entire range;
  • Right or Up Arrow + Ctrl/Cmd - Moves a component's handle to the right or the entire range with step equal to 1/10th of the entire range;
  • Plus - Same as Right or Up Arrow;
  • Minus - Same as Left or Down Arrow;
  • Home - Moves the entire selection or the selected handle to the beginning of the component's range;
  • End - Moves the entire selection or the selected handle to the end of the component's range;
  • Page Up - Same as Right or Up Arrow + Ctrl/Cmd;
  • Page Down - Same as Left or Down Arrow + Ctrl/Cmd;
  • Escape - Resets the startValue and endValue properties to the values prior the component focusing;

ES6 Module Import

import "@ui5/webcomponents/dist/RangeSlider";

Properties/Attributes

You can use both properties and attributes with the same effect. The name of each attribute is listed below the name of the property, if different.

Name
Type
Default Value
Description
endValue
end-value
Float
100
Defines end point of a selection - position of a second handle on the slider.

startValue
start-value
Float
0
Defines start point of a selection - position of a first handle on the slider.

disabled
boolean
false
Defines whether the slider is in disabled state.
labelInterval
label-interval
Integer
0
Displays a label with a value on every N-th step.

Note: The step and tickmarks properties must be enabled. Example - if the step value is set to 2 and the label interval is also specified to 2 - then every second tickmark will be labelled, which means every 4th value number.
max
Float
100
Defines the maximum value of the slider.
min
Float
0
Defines the minimum value of the slider.
showTickmarks
show-tickmarks
boolean
false
Enables tickmarks visualization for each step.

Note: The step must be a positive number.
showTooltip
show-tooltip
boolean
false
Enables handle tooltip displaying the current value.
step
Integer
1
Defines the size of the slider's selection intervals (e.g. min = 0, max = 10, step = 5 would result in possible selection of the values 0, 5, 10).

Note: If set to 0 the slider handle movement is disabled. When negative number or value other than a number, the component fallbacks to its default value.

Events

This Web Component fires semantic events upon user interaction. You can bind to these events with the standard DOM APIs, such as addEventListener.

Name
Description
change
Fired when the value changes and the user has finished interacting with the slider.
input
Fired when the value changes due to user interaction that is not yet finished - during mouse/touch dragging.
Theme: Quartz Light Quartz Dark Quartz High Contrast Black Quartz High Contrast White Belize High Contrast Black High Contrast White Horizon
Content Density: Cozy Compact
Text Direction: LTR RTL
Apply Cancel