UNPKG

2.26 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { OverridableComponent, OverrideProps } from '../OverridableComponent';
4import { Theme } from '../styles';
5import { PaperProps } from '../Paper';
6import { StepperClasses } from './stepperClasses';
7
8export type Orientation = 'horizontal' | 'vertical';
9
10export interface StepperOwnProps extends Pick<PaperProps, 'elevation' | 'square' | 'variant'> {
11 /**
12 * Set the active step (zero based index).
13 * Set to -1 to disable all the steps.
14 * @default 0
15 */
16 activeStep?: number;
17 /**
18 * If set to 'true' and orientation is horizontal,
19 * then the step label will be positioned under the icon.
20 * @default false
21 */
22 alternativeLabel?: boolean;
23 /**
24 * Two or more `<Step />` components.
25 */
26 children?: React.ReactNode;
27 /**
28 * Override or extend the styles applied to the component.
29 */
30 classes?: Partial<StepperClasses>;
31 /**
32 * An element to be placed between each step.
33 * @default <StepConnector />
34 */
35 connector?: React.ReactElement<unknown, any> | null;
36 /**
37 * If set the `Stepper` will not assist in controlling steps for linear flow.
38 * @default false
39 */
40 nonLinear?: boolean;
41 /**
42 * The component orientation (layout flow direction).
43 * @default 'horizontal'
44 */
45 orientation?: Orientation;
46 /**
47 * The system prop that allows defining system overrides as well as additional CSS styles.
48 */
49 sx?: SxProps<Theme>;
50}
51
52export interface StepperTypeMap<
53 AdditionalProps = {},
54 RootComponent extends React.ElementType = 'div',
55> {
56 props: AdditionalProps & StepperOwnProps;
57 defaultComponent: RootComponent;
58}
59
60export type StepperProps<
61 RootComponent extends React.ElementType = StepperTypeMap['defaultComponent'],
62 AdditionalProps = { component?: React.ElementType },
63> = OverrideProps<StepperTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
64 component?: React.ElementType;
65};
66
67export type StepperClasskey = keyof NonNullable<StepperProps['classes']>;
68
69/**
70 *
71 * Demos:
72 *
73 * - [Stepper](https://mui.com/material-ui/react-stepper/)
74 *
75 * API:
76 *
77 * - [Stepper API](https://mui.com/material-ui/api/stepper/)
78 */
79declare const Stepper: OverridableComponent<StepperTypeMap>;
80
81export default Stepper;