UNPKG

2.85 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { InternalStandardProps as StandardProps } from '..';
4import { StepIconProps } from '../StepIcon';
5import { Theme } from '../styles';
6import { StepLabelClasses } from './stepLabelClasses';
7import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
8
9export interface StepLabelSlots {
10 /**
11 * The component that renders the label.
12 * @default span
13 */
14 label: React.ElementType;
15 /**
16 * The component to render in place of the [`StepIcon`](https://mui.com/material-ui/api/step-icon/).
17 */
18 stepIcon: React.ElementType<StepIconProps>;
19}
20
21export type StepLabelSlotsAndSlotProps = CreateSlotsAndSlotProps<
22 StepLabelSlots,
23 {
24 label: SlotProps<React.ElementType<React.HTMLProps<HTMLSpanElement>>, {}, StepLabelOwnerState>;
25 stepIcon: SlotProps<React.ElementType<StepIconProps>, {}, StepLabelOwnerState>;
26 }
27>;
28
29export interface StepLabelOwnerState extends StepLabelProps {}
30
31export interface StepLabelProps
32 extends StandardProps<React.HTMLAttributes<HTMLDivElement>>,
33 StepLabelSlotsAndSlotProps {
34 /**
35 * In most cases will simply be a string containing a title for the label.
36 */
37 children?: React.ReactNode;
38 /**
39 * Override or extend the styles applied to the component.
40 */
41 classes?: Partial<StepLabelClasses>;
42 /**
43 * The props used for each slot inside.
44 * @default {}
45 * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
46 */
47 componentsProps?: {
48 /**
49 * Props applied to the label element.
50 * @default {}
51 */
52 label?: React.HTMLProps<HTMLSpanElement>;
53 };
54 /**
55 * If `true`, the step is marked as failed.
56 * @default false
57 */
58 error?: boolean;
59 /**
60 * Override the default label of the step icon.
61 */
62 icon?: React.ReactNode;
63 /**
64 * The optional node to display.
65 */
66 optional?: React.ReactNode;
67 /**
68 * The component to render in place of the [`StepIcon`](https://mui.com/material-ui/api/step-icon/).
69 */
70 StepIconComponent?: React.ElementType<StepIconProps>;
71 /**
72 * Props applied to the [`StepIcon`](https://mui.com/material-ui/api/step-icon/) element.
73 */
74 StepIconProps?: Partial<StepIconProps>;
75 /**
76 * The system prop that allows defining system overrides as well as additional CSS styles.
77 */
78 sx?: SxProps<Theme>;
79}
80
81export type StepLabelClasskey = keyof NonNullable<StepLabelProps['classes']>;
82
83/**
84 *
85 * Demos:
86 *
87 * - [Stepper](https://mui.com/material-ui/react-stepper/)
88 *
89 * API:
90 *
91 * - [StepLabel API](https://mui.com/material-ui/api/step-label/)
92 */
93declare const StepLabel: ((props: StepLabelProps) => React.JSX.Element) & {
94 muiName: string;
95};
96
97export default StepLabel;
98
\No newline at end of file