Skip to content

Properties

PropertyTypeDescription
valuenumber
Array<number>
(required) The value of the slider as a number or an array. If an array with numbers is provided, each number will represent a thumb button (the + and - button will be hidden on multiple thumbs).
minnumber(optional) The minimum value. Can be a negative number as well. Defaults to 0.
maxnumber(optional) The maximum value. Defaults to 100.
stepnumber(optional) The steps the slider takes on changing the value. Defaults to null.
verticalboolean(optional) Show the slider vertically. Defaults to false.
reverseboolean(optional) Show the slider reversed. Defaults to false.
stretchboolean(optional) If set to true, then the slider will be 100% in width.
hideButtonsboolean(optional) Removes the helper buttons. Defaults to false.
multiThumbBehaviorstring(optional) Use either omit, push or swap. This property only works for two (range) or more thumb buttons, while omit will stop the thumb from swapping, push will push its nearest thumb along. Defaults to swap.
thumbTitlestring(optional) Give the slider thumb button a title for accessibility reasons. Defaults to null.
subtractTitlestring(optional) Give the subtract button a title for accessibility reasons. Defaults to .
addTitlestring(optional) Give the add button a title for accessibility reasons. Defaults to +.
numberFormatobject(optional) Will extend the return object with a number property (from onChange event). You can use all the options from the NumberFormat component. It also will use that formatted number in the increase/decrease buttons. If it has to represent a currency, then use e.g. numberFormat={{ currency: true, decimals: 0 }}
tooltipboolean(optional) Use true to show a tooltip on mouseOver, touchStart and focus, showing the current number (if numberFormat is given) or the raw value.
alwaysShowTooltipboolean(optional) Use true to always show the tooltip, in addition to the tooltip property.
labelstring(optional) Prepends the Form Label component. If no ID is provided, a random ID is created.
labelDirectionstring(optional) Use labelDirection="vertical" to change the label layout direction. Defaults to horizontal.
labelSrOnlyboolean(optional) Use true to make the label only readable by screen readers.
statusstring(optional) Text with a status message. The style defaults to an error message. You can use true to only get the status color, without a message.
statusStatestring(optional) Defines the state of the status. Currently, there are two statuses [error, info]. Defaults to error.
statusPropsobject(optional) Use an object to define additional FormStatus properties.
globalStatusIdstring(optional) The status_id used for the target GlobalStatus.
suffixstring(optional) Text describing the content of the Slider more than the label. You can also send in a React component, so it gets wrapped inside the Slider component.
skeletonboolean(optional) If set to true, an overlaying skeleton with animation will be shown.
extensionsobject(optional) Makes it possible to display overlays with other functionality such as a marker on the slider marking a given value.
Spacestring
object
(optional) Spacing properties like top or bottom are supported.

Translations

More info about translations can be found in the general localization and Eufemia Forms localization docs.

Keynb-NOen-GBen-US
Slider.addTitleØk (%s)Increase (%s)Increase (%s)
Slider.subtractTitleReduser (%s)Decrease (%s)Decrease (%s)

Extensions

A Slider Extension should be an object with the following properties:

import Slider, { SliderMarker } from '@dnb/eufemia/components/Slider'
render(
<Slider
extensions={{
marker: {
instance: SliderMarker,
value: 50,
},
}}
/>,
)