PreactRangeSlider API
Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.
PreactRangeSlider21 props2 callbacks0 methods
Props21
| Name | Type | Description |
|---|---|---|
minRequired | number | Minimum value for the range |
maxRequired | number | Maximum value for the range |
fromValueRequired | number | Current value for the start of the range |
toValueRequired | number | Current value for the end of the range |
stepOptional | number | undefined | Value-domain increment for native range handles. Defaults to the slider's decimal precision. |
showTooltipsOptional | boolean | undefined | Whether to show tooltips on hover |
showRangeDisplayOptional | boolean | undefined | Whether to show the current range values above the slider |
showRangeInputsOptional | boolean | undefined | Whether to show numeric inputs for editing the selected range |
disabledOptional | boolean | undefined | Disable both native range handles. |
scaleFactorOptional | number | undefined | Scaling used to preserve decimals in native range inputs. Defaults to 100. |
classNameOptional | string | undefined | Extra class on the shared slider root. |
controlClassNameOptional | string | undefined | Extra class on the shared dual-handle control. |
fromClassNameOptional | string | undefined | Extra classes retained by feature adapters. |
toClassNameOptional | string | undefined | Additional CSS classes for the to part of the component. |
fromAriaLabelOptional | string | undefined | Accessible names for the two native range handles. |
toAriaLabelOptional | string | undefined | Accessible label for the upper endpoint of the range slider. |
formatInputValueOptional |
| Optional function to format values inside the editable inputs. Defaults to `String(value)`, which keeps dot decimals independent of the browser's localized number input rendering. |
parseInputValueOptional |
| Optional function to parse editable input text back to a number. Return `NaN` to ignore incomplete or invalid text while the user is typing. The default parser accepts both dot and comma decimal separators. |
formatValueOptional |
| Optional function to format read-only labels and tooltips. Editable inputs use `formatInputValue` so display labels and input text can intentionally use different formats. |
formatFromValueOptional |
| Optional handle-specific display/accessible value formatters. |
formatToValueOptional |
| Formats the upper endpoint value of a range slider. |
Events and callbacks2
| Name | Type | Description |
|---|---|---|
onRangeChangeRequired |
| Callback fired when the range values change |
onRangeCommitOptional |
| Callback fired when a native handle commits its change. |
Methods0
No component-specific imperative methods. Use props and callbacks to control this component.