# xy-steps

> 基于 React Hooks 的步骤条组件

Latest version **0.1.0** (published 2019-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install xy-steps
pnpm add xy-steps
yarn add xy-steps
bun add xy-steps
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-11-19 |
| First published | 2019-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | XueYou |
| Maintainers | xueyou2000 |
| Keywords | react, react-component, xy-steps |

## Links

- npm: https://www.npmjs.com/package/xy-steps
- Repository: https://github.com/xueyou2000/xy-steps
- Homepage: https://github.com/xueyou2000/xy-steps#readme
- Issues: https://github.com/xueyou2000/xy-steps/issues
- npm.io page: https://npm.io/package/xy-steps

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^16.12.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.12.0
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) ^0.1.4
- [@fortawesome/free-solid-svg-icons](https://npm.io/package/@fortawesome/free-solid-svg-icons.md) ^5.10.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-11-19
- 0.0.4 — 2019-09-03
- 0.0.3 — 2019-05-13
- 0.0.2 — 2019-05-07

## README

| ![IE](https://github.com/alrra/browser-logos/blob/master/src/edge/edge_48x48.png?raw=true) | ![Chrome](https://github.com/alrra/browser-logos/blob/master/src/chrome/chrome_48x48.png?raw=true) | ![Firefox](https://github.com/alrra/browser-logos/blob/master/src/firefox/firefox_48x48.png?raw=true) | ![Opera](https://github.com/alrra/browser-logos/blob/master/src/opera/opera_48x48.png?raw=true) | ![Safari](https://github.com/alrra/browser-logos/blob/master/src/safari/safari_48x48.png?raw=true) |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| IE 10+ ✔                                                                                   | Chrome 31.0+ ✔                                                                                     | Firefox 31.0+ ✔                                                                                       | Opera 30.0+ ✔                                                                                   | Safari 7.0+ ✔                                                                                      |

![NPM version](http://img.shields.io/npm/v/xy-steps.svg?style=flat-square)
![node version](https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square)
![npm download](https://img.shields.io/npm/dm/xy-steps.svg?style=flat-square)

[![xy-steps](https://nodei.co/npm/xy-steps.png)](https://npmjs.org/package/xy-steps)

# xy-steps

步骤条组件

## 安装

```bash
# yarn
yarn add xy-steps
```

## 使用例子

```tsx
import React from "react";
import ReactDOM from "react-dom";
import { Steps, Step } from "xy-steps";
ReactDOM.render(
    <Steps step={2}>
        <Step title="Finished">This is a description.</Step>
        <Step title="In Progress">This is a description.</Step>
        <Step title="Waiting">This is a description.</Step>
    </Steps>,
    container,
);
```

## API

### Steps

| 属性      | 说明                                                               | 类型   | 默认值     |
| --------- | ------------------------------------------------------------------ | ------ | ---------- |
| step      | 当前步骤, 从数字 1 开始                                            | number | 1          |
| status    | 当前步骤状态, 可选值为 `wait` `process` `finnish` `error` 或者不设 | string | -          |
| direction | 方向, 可选值为 `horizontal` `vertical`                             | string | horizontal |
| size      | 设置按钮大小，可选值为 `small` `large` 或者不设                    | string | default    |

### Step

| 属性     | 说明                    | 类型            | 默认值 |
| -------- | ----------------------- | --------------- | ------ |
| step     | 当前步骤, 从数字 1 开始 | number          | 1      |
| title    | 步骤标题                | React.ReactNode | -      |
| children | 步骤描述                | React.ReactNode | -      |
| icon     | 步骤图标                | React.ReactNode | -      |

## 开发

```sh
yarn run start
```

## 例子

http://localhost:6006

## 测试

```
yarn run test
```

## 开源许可

xy-steps is released under the MIT license.

---
_Source: https://npm.io/package/xy-steps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
