Skip to content

Commit

Permalink
[MobileStepper] Add a LinearProgressProps property (#12404)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Aug 3, 2018
1 parent 81c8d84 commit cbc6828
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
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

0 comments on commit cbc6828

Please sign in to comment.