useSlider
useSlider
is a custom hook used to provide slider functionality, as well as
state and focus management to custom slider components when using it.
Import#
import { useSlider } from '@fluidtruck/core'
Return value#
The useSlider
hook returns the following props
Name | Type | Description |
---|---|---|
state | SliderState | An object that contains all the props that define the current state of the slider. |
actions | SliderActions | An object that contains all the functions that can be called to modify the slider's value |
getRootProps | PropGetter | A function that takes slider root props and handles changes for the slider. |
getTrackProps | PropGetter | A function that takes slider track props and handles changes for the slider's track. |
getInnerTrackProps | PropGetter | A function that takes slider inner track style props and handles changes in the slider's inner track style. |
getThumbProps | PropGetter | A function that takes slider thumb props and handles changes for the slider's thumb. |
getMarkerProps | RequiredPropGetter<{ value: number }> | A function that takes the value of the marker and handles changes for the slider's marker positioning and style. |
getInputProps | PropGetter | A function to get the props of the input field. |
Usage#
Parameters#
The useSlider
hook accepts an object with the following properties: