Skip to content

Commit f687471

Browse files
committed
[Slider] Add components prop
1 parent a985ae7 commit f687471

File tree

1 file changed

+58
-13
lines changed

1 file changed

+58
-13
lines changed

packages/mui-joy/src/Slider/SliderProps.ts

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,71 @@ export type SliderSlot =
1515
| 'input';
1616

1717
export interface SliderPropsVariantOverrides {}
18-
1918
export interface SliderPropsColorOverrides {}
20-
2119
export interface SliderPropsSizeOverrides {}
2220

21+
interface ComponentsProps {
22+
root?: SlotComponentProps<
23+
'span',
24+
{ component?: React.ElementType; sx?: SxProps },
25+
SliderOwnerState
26+
>;
27+
track?: SlotComponentProps<
28+
'span',
29+
{ component?: React.ElementType; sx?: SxProps },
30+
SliderOwnerState
31+
>;
32+
rail?: SlotComponentProps<
33+
'span',
34+
{ component?: React.ElementType; sx?: SxProps },
35+
SliderOwnerState
36+
>;
37+
thumb?: SlotComponentProps<
38+
'span',
39+
{ component?: React.ElementType; sx?: SxProps },
40+
SliderOwnerState
41+
>;
42+
mark?: SlotComponentProps<
43+
'span',
44+
{ component?: React.ElementType; sx?: SxProps },
45+
SliderOwnerState
46+
>;
47+
markLabel?: SlotComponentProps<
48+
'span',
49+
{ component?: React.ElementType; sx?: SxProps },
50+
SliderOwnerState
51+
>;
52+
valueLabel?: SlotComponentProps<
53+
'span',
54+
{ component?: React.ElementType; sx?: SxProps },
55+
SliderOwnerState
56+
>;
57+
input?: SlotComponentProps<
58+
'input',
59+
{ component?: React.ElementType; sx?: SxProps },
60+
SliderOwnerState
61+
>;
62+
}
63+
2364
export interface SliderOwnProps {
2465
/**
25-
* The props used for each slot inside the Slider.
26-
* @default {}
66+
* Replace the default slots.
2767
*/
28-
componentsProps?: {
29-
root?: SlotComponentProps<'span', { sx?: SxProps }, SliderOwnerState>;
30-
track?: SlotComponentProps<'span', { sx?: SxProps }, SliderOwnerState>;
31-
rail?: SlotComponentProps<'span', { sx?: SxProps }, SliderOwnerState>;
32-
thumb?: SlotComponentProps<'span', { sx?: SxProps }, SliderOwnerState>;
33-
mark?: SlotComponentProps<'span', { sx?: SxProps }, SliderOwnerState>;
34-
markLabel?: SlotComponentProps<'span', { sx?: SxProps }, SliderOwnerState>;
35-
valueLabel?: SlotComponentProps<'span', { sx?: SxProps }, SliderOwnerState>;
36-
input?: SlotComponentProps<'input', { sx?: SxProps }, SliderOwnerState>;
68+
components?: {
69+
root?: React.ElementType;
70+
track?: React.ElementType;
71+
rail?: React.ElementType;
72+
thumb?: React.ElementType;
73+
mark?: React.ElementType;
74+
markLabel?: React.ElementType;
75+
valueLabel?: React.ElementType;
76+
input?: React.ElementType;
3777
};
78+
/**
79+
* The props used for each slot inside the component.
80+
* @default {}
81+
*/
82+
componentsProps?: ComponentsProps;
3883
/**
3984
* The color of the component. It supports those theme colors that make sense for this component.
4085
* @default 'primary'

0 commit comments

Comments
 (0)