@@ -7,6 +7,15 @@ export interface SliderProps extends ChakraSlider.RootProps {
7
7
showValue ?: boolean ;
8
8
}
9
9
10
+ /**
11
+ * Slider component that allows users to select a value from a range.
12
+ *
13
+ * @param {SliderProps } props - The properties for the slider component.
14
+ * @param {Array<number | { value: number; label: React.ReactNode }> } [props.marks] - The marks to display on the slider.
15
+ * @param {React.ReactNode } [props.label] - The label for the slider.
16
+ * @param {boolean } [props.showValue] - Whether to show the current value of the slider.
17
+ * @returns {JSX.Element } The rendered slider component.
18
+ */
10
19
export const Slider = React . forwardRef < HTMLDivElement , SliderProps > ( function Slider ( props , ref ) {
11
20
const { marks : marksProp , label, showValue, ...rest } = props ;
12
21
const value = props . defaultValue ?? props . value ;
@@ -40,6 +49,13 @@ export const Slider = React.forwardRef<HTMLDivElement, SliderProps>(function Sli
40
49
) ;
41
50
} ) ;
42
51
52
+ /**
53
+ * SliderThumbs component that renders the thumbs for the slider.
54
+ *
55
+ * @param {Object } props - The properties for the slider thumbs component.
56
+ * @param {number[] } [props.value] - The values for the thumbs.
57
+ * @returns {JSX.Element } The rendered slider thumbs component.
58
+ */
43
59
function SliderThumbs ( props : { value ?: number [ ] } ) {
44
60
const { value } = props ;
45
61
return (
@@ -57,6 +73,13 @@ interface SliderMarksProps {
57
73
marks ?: Array < number | { value : number ; label : React . ReactNode } > ;
58
74
}
59
75
76
+ /**
77
+ * SliderMarks component that renders the marks for the slider.
78
+ *
79
+ * @param {SliderMarksProps } props - The properties for the slider marks component.
80
+ * @param {Array<number | { value: number; label: React.ReactNode }> } [props.marks] - The marks to display on the slider.
81
+ * @returns {JSX.Element | null } The rendered slider marks component or null if no marks are provided.
82
+ */
60
83
const SliderMarks = React . forwardRef < HTMLDivElement , SliderMarksProps > ( function SliderMarks ( props , ref ) {
61
84
const { marks } = props ;
62
85
if ( ! marks ?. length ) {
0 commit comments