Skip to content

Commit d0ac59c

Browse files
committed
[Chip, CircularProgress] Add components prop to API docs
1 parent 05fb796 commit d0ac59c

File tree

4 files changed

+38
-10
lines changed

4 files changed

+38
-10
lines changed

packages/mui-joy/src/Chip/Chip.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,17 @@ Chip.propTypes /* remove-proptypes */ = {
329329
PropTypes.string,
330330
]),
331331
/**
332-
* The component used for the root node.
333-
* Either a string to use a HTML element or a component.
332+
* Replace the default slots.
334333
*/
335-
component: PropTypes.elementType,
334+
components: PropTypes.shape({
335+
action: PropTypes.elementType,
336+
endDecorator: PropTypes.elementType,
337+
label: PropTypes.elementType,
338+
root: PropTypes.elementType,
339+
startDecorator: PropTypes.elementType,
340+
}),
336341
/**
337-
* The props used for each slot inside the component.
342+
* The props used for each slot inside.
338343
* @default {}
339344
*/
340345
componentsProps: PropTypes.shape({

packages/mui-joy/src/Chip/ChipProps.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
4545
*/
4646
children?: React.ReactNode;
4747
/**
48-
* The props used for each slot inside the component.
48+
* Replace the default slots.
49+
*/
50+
components?: {
51+
root?: React.ElementType;
52+
label?: React.ElementType;
53+
action?: React.ElementType;
54+
startDecorator?: React.ElementType;
55+
endDecorator?: React.ElementType;
56+
};
57+
/**
58+
* The props used for each slot inside.
4959
* @default {}
5060
*/
5161
componentsProps?: ComponentsProps;

packages/mui-joy/src/CircularProgress/CircularProgress.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,16 @@ CircularProgress.propTypes /* remove-proptypes */ = {
304304
PropTypes.string,
305305
]),
306306
/**
307-
* The component used for the root node.
308-
* Either a string to use a HTML element or a component.
307+
* Replace the default slots.
309308
*/
310-
component: PropTypes.elementType,
309+
components: PropTypes.shape({
310+
progress: PropTypes.elementType,
311+
root: PropTypes.elementType,
312+
svg: PropTypes.elementType,
313+
track: PropTypes.elementType,
314+
}),
311315
/**
312-
* The props used for each slot inside the CircularProgress.
316+
* The props used for each slot inside.
313317
* @default {}
314318
*/
315319
componentsProps: PropTypes.shape({

packages/mui-joy/src/CircularProgress/CircularProgressProps.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ export interface CircularProgressTypeMap<P = {}, D extends React.ElementType = '
4040
*/
4141
color?: OverridableStringUnion<ColorPaletteProp, CircularProgressPropsColorOverrides>;
4242
/**
43-
* The props used for each slot inside the CircularProgress.
43+
* Replace the default slots.
44+
*/
45+
components?: {
46+
root?: React.ElementType;
47+
svg?: React.ElementType;
48+
track?: React.ElementType;
49+
progress?: React.ElementType;
50+
};
51+
/**
52+
* The props used for each slot inside.
4453
* @default {}
4554
*/
4655
componentsProps?: ComponentsProps;

0 commit comments

Comments
 (0)