Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MobileStepper] Add a LinearProgressProps property #12404

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/material-ui/src/MobileStepper/MobileStepper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import * as React from 'react';
import { StandardProps } from '..';
import { PaperProps } from '../Paper';
import { ButtonProps } from '../Button';
import { LinearProgressProps } from '../LinearProgress';

export interface MobileStepperProps extends StandardProps<PaperProps, MobileStepperClassKey> {
activeStep?: number;
backButton: React.ReactElement<any>;
LinearProgressProps?: Partial<LinearProgressProps>;
nextButton: React.ReactElement<any>;
position?: 'bottom' | 'top' | 'static';
steps: number;
Expand Down
6 changes: 6 additions & 0 deletions packages/material-ui/src/MobileStepper/MobileStepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function MobileStepper(props) {
backButton,
classes,
className: classNameProp,
LinearProgressProps,
nextButton,
position,
steps,
Expand Down Expand Up @@ -97,6 +98,7 @@ function MobileStepper(props) {
className={classes.progress}
variant="determinate"
value={Math.ceil((activeStep / (steps - 1)) * 100)}
{...LinearProgressProps}
/>
)}
{nextButton}
Expand All @@ -123,6 +125,10 @@ MobileStepper.propTypes = {
* @ignore
*/
className: PropTypes.string,
/**
* Properties applied to the `LinearProgress` element.
*/
LinearProgressProps: PropTypes.object,
/**
* A next button element. For instance, it can be be a `Button` or a `IconButton`.
*/
Expand Down
1 change: 1 addition & 0 deletions pages/api/mobile-stepper.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ title: MobileStepper API
| <span class="prop-name">activeStep</span> | <span class="prop-type">number | <span class="prop-default">0</span> | Set the active step (zero based index). Defines which dot is highlighted when the variant is 'dots'. |
| <span class="prop-name">backButton</span> | <span class="prop-type">node |   | A back button element. For instance, it can be be a `Button` or a `IconButton`. |
| <span class="prop-name">classes</span> | <span class="prop-type">object |   | Override or extend the styles applied to the component. See [CSS API](#css-api) below for more details. |
| <span class="prop-name">LinearProgressProps</span> | <span class="prop-type">object |   | Properties applied to the `LinearProgress` element. |
| <span class="prop-name">nextButton</span> | <span class="prop-type">node |   | A next button element. For instance, it can be be a `Button` or a `IconButton`. |
| <span class="prop-name">position</span> | <span class="prop-type">enum:&nbsp;'bottom'&nbsp;&#124;<br>&nbsp;'top'&nbsp;&#124;<br>&nbsp;'static'<br> | <span class="prop-default">'bottom'</span> | Set the positioning type. |
| <span class="prop-name required">steps *</span> | <span class="prop-type">number |   | The total steps. |
Expand Down