Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rc-steps

react-component6mMIT6.0.1TypeScript support: included

steps ui component for react

react, react-component, react-steps

readme

rc-steps


React steps component.

NPM version build status Test coverage npm download bundle size

Usage

npm install rc-steps

`jsx | pure <Steps current={1}> <Steps.Step title="first" /> <Steps.Step title="second" /> <Steps.Step title="third" /> </Steps>


## Example

https://react-component.github.io/steps/

## API

<table class="table table-bordered table-striped">
  <thead>
    <tr>
      <th style="width: 100px;">name</th>
      <th style="width: 50px;">type</th>
      <th style="width: 50px;">default</th>
      <th>description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>type</td>
      <td>string</td>
      <td>default</td>
      <td>diretypetion of Steps, could be `default` `navigation` `inline`</td>
    </tr>
    <tr>
      <td>direction</td>
      <td>string</td>
      <td>horizontal</td>
      <td>direction of Steps, enum: `horizontal` or `vertical`</td>
    </tr>
    <tr>
      <td>current</td>
      <td>number</td>
      <td>0</td>
      <td>index of current step</td>
    </tr>
    <tr>
      <td>initial</td>
      <td>number</td>
      <td>0</td>
      <td>index initial</td>
    </tr>
    <tr>
      <td>size</td>
      <td>string</td>
      <td></td>
      <td>size of Steps, could be `small`</td>
    </tr>
    <tr>
      <td>labelPlacement</td>
      <td>string</td>
      <td></td>
      <td>placement of step title, could be `vertical`</td>
    </tr>
    <tr>
      <td>status</td>
      <td>string</td>
      <td>wait</td>
      <td>status of current Steps, could be `error` `process` `finish` `wait`</td>
    </tr>
    <tr>
      <td>icons</td>
      <td>{ finish: ReactNode, error: ReactNode }</td>
      <td></td>
      <td>specify the default finish icon and error icon</td>
    </tr>
    <tr>
      <td>itemRender</td>
      <td>(item: StepProps, stepItem: React.ReactNode) => React.ReactNode</td>
      <td></td>
      <td>custom step item renderer</td>
    </tr>
    <tr>
      <td>onChange</td>
      <td>(current: number) => void</td>
      <td></td>
      <td>Trigger when Step changed</td>
    </tr>
  </tbody>
</table>

### Steps.Step

<table class="table table-bordered table-striped">
  <thead>
    <tr>
      <th style="width: 100px;">name</th>
      <th style="width: 50px;">type</th>
      <th style="width: 50px;">default</th>
      <th>description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>title</td>
      <td>ReactNode</td>
      <td></td>
      <td>title of step item</td>
    </tr>
    <tr>
      <td>subTitle</td>
      <td>ReactNode</td>
      <td></td>
      <td>subTitle of step item</td>
    </tr>
    <tr>
      <td>description</td>
      <td>ReactNode</td>
      <td></td>
      <td>description of step item</td>
    </tr>
    <tr>
      <td>icon</td>
      <td>ReactNode</td>
      <td></td>
      <td>set icon of step item</td>
    </tr>
    <tr>
      <td>status</td>
      <td>string</td>
      <td></td>
      <td>status of current Steps, could be `error` `process` `finish` `wait`</td>
    </tr>
    <tr>
      <td>tailContent</td>
      <td>ReactNode</td>
      <td></td>
      <td>content above tail</td>
    </tr>
    <tr>
      <td>disabled</td>
      <td>bool</td>
      <td>false</td>
      <td>disabled step when onChange exist</td>
    </tr>
    <tr>
      <td>render</td>
      <td>(stepItem: React.ReactNode) => React.ReactNode</td>
      <td></td>
      <td>custom step item renderer</td>
    </tr>
  </tbody>
</table>

## Development

npm install npm start `

License

rc-steps is released under the MIT license.

changelog

History


3.6.0

  • Remove babel-runtime and prop-types
  • Fix icon missing #85

3.5.0

  • Support navigation type & disabled prop.

3.4.0

  • Support onChange event.

3.3.0

  • Add icons prop for change preset icon.

3.2.0

  • Add initial prop.

3.1.0

  • Add tailContent.

3.0.0

  • Rewrite from bottom.

2.5.1

2.5.0

  • Refactor for last tail style.

2.4.0

2.3.0

  • Add new step style of prop progressDot.

2.2.0

  • icon can be React.Node now.

2.1.0

  • Add labelPlacement, support vertial title and description

2.0.0

  • Refactor for better layout

1.5

  • add status property of Steps

1.4

  • update react to 0.14

1.3

  • add current property of Steps

1.2.3

  • fix publish

1.2.2

  • remove vertical maxDescriptionWidth

1.2.1

  • fix vertical maxDescriptionWidth

1.2.0

  • add vertical steps

1.1.4

  • fix layout algorithm

1.1.3

  • support iconPrefix property, default is rc

1.1.2

  • fix bugs

1.1.1

  • support maxDescriptionWidth property, default is 120

1.1.0

  • support prefixCls property, default is rc-steps