Skip to main content

Range Slider
Ready

Range Slider lets user specify a numeric value using a slider which must be no less than a given value, and no more than another given value.

Examples

Open in new window
<duet-range-slider
label="Sijoitettava pääoma"
value="3000"
min="100"
max="10000"
step="100"
unit=""
debounce="500">

</duet-range-slider>

<script>
// Select the above range slider component
var range = document.querySelector("duet-range-slider")

// Listen for change events. Use debounce prop to adjust the time to trigger this.
range.addEventListener("duetChange", function(e) {
console.log("Change detected in range slider:", e.detail)
})
</script>
Open in new window
<duet-range-slider
label="Sijoitettava pääoma"
value="3000"
min="100"
max="10000"
step="100"
unit=""
debounce="500"
expand>

</duet-range-slider>
Open in new window
<duet-range-slider
label="This label is hidden, but still visible for screen readers"
label-hidden
value="2"
min="1"
max="3"
step="1">

</duet-range-slider>

Properties #

Property Attribute Description Type Default
debounce debounce Set the amount of time, in milliseconds, to wait to trigger the duetChange event after each keystroke. number 0
expand expand Expands the input to fill 100% of the container width. boolean false
identifier identifier Adds a unique identifier for the input. string undefined
label label Label for the range slider. string "label"
labelHidden label-hidden Visually hide the label, but still show it to screen readers. boolean false
locale locale "en-GB" | "en-US" | "fi-FI" | "sv-SE" "fi-FI"
margin margin Controls the margin of the component. "auto" | "none" "auto"
max max Maximum value. number 100
min min Minimum value. number 0
step step Step amount. number 1
theme theme Theme of the input. "" | "default" | "turva" ""
unit unit Unit for the range slider. string ""
value value Value of the input. number 0

Events #

Event Description Type
duetChange Emitted when the value has changed. CustomEvent<{ originalEvent?: Event; component: "duet-range-slider"; value: number; }>
duetInput Emitted when a keyboard input ocurred. CustomEvent<{ originalEvent?: Event; component: "duet-range-slider"; value: number; }>

Methods #

setFocus() => Promise<void> #

Sets focus on the specified duet-range-slider. Use this method instead of the global
input.focus().

Returns #

Type: Promise<void>

Dependencies #

Depends on #

Graph #

graph TD;
duet-range-slider --> duet-label
style duet-range-slider fill:#f9f,stroke:#333,stroke-width:4px

Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.



Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Abstract

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown

Tutorials

VS Code

Tutorials

Zeplin


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.