English | 简体中文
React-Loading是一个基于 React 的 Loading 动画组件库,拥有许多精致且漂亮的 loading 组件,在你的项目中适当的地方与时刻比如页面局部处于等待异步数据或正在渲染过程时给予加载动效提示,会有效缓解用户的焦虑。本组件库支持按需加载,那么,现在就挑选一个喜欢的 Loading 组件,丰富你的项目吧~
🎉 查看 demo
在1.7.4-alpha.2版本之后使用了typescript重构了项目。
npm install react-loadingg
import { BoxLoading } from 'react-loadingg';
<BoxLoading />;
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| color | 设置颜色,支持16进制与RGB | string | '#00adb5' |
| speed | 设置动画速度 | number(秒) | - |
| size | 设置组件大小,可选值为 small default large |
string | 'default' |
| style | 设置组件样式 | Object | - |
| 组件 | color | speed | size | style |
|---|---|---|---|---|
| BabelLoading | ✅ | ✅ | ✅ | ✅ |
| BlockLoading | ✅ | ✅ | ✅ | ✅ |
| BlockReserveLoading | ✅ | ✅ | ✅ | ✅ |
| BoxLoading | ✅ | ✅ | ✅ | ✅ |
| CircleLoading | ✅ | ✅ | ✅ | ✅ |
| CircleToBlockLoading | ✅ | ✅ | ✅ | ✅ |
| CommonLoading | ✅ | ✅ | ✅ | ✅ |
| DisappearedLoading | ✅ | ✅ | ✅ | ✅ |
| LoopCircleLoading | ✅ | ✅ | ✅ | ✅ |
| NineCellLoading | ✅ | ✅ | ✅ | ✅ |
| TouchBallLoading | ✅ | ✅ | ✅ | ✅ |
| TransverseLoading | ✅ | ✅ | ✅ | ✅ |
| WaveLoading | ✅ | ✅ | ✅ | ✅ |
| WaveTopBottomLoading | ✅ | ✅ | ✅ | ✅ |
| WindMillLoading | ✅ | ✅ | ✅ | ✅ |
| JumpCircleLoading | ✅ | ✅ | ✅ | ✅ |
| MeteorRainLoading | ✅ | ✅ | ✅ | ✅ |
| RotateCircleLoading | ✅ | ✅ | ✅ | ✅ |
| StickyBallLoading | ✅ | ✅ | ✅ | ✅ |
| SemipolarLoading | ✅ | ✅ | ✅ | ✅ |
| SolarSystemLoading | ✅ | ✅ | ✅ | ✅ |
| LadderLoading | ✅ | ✅ | ✅ | ✅ |
| HeartBoomLoading | ✅ | ✅ | ✅ | ✅ |
| RollBoxLoading | ✅ | ✅ | ✅ | ✅ |
| RectGraduallyShowLoading | ✅ | ✅ | ✅ | ✅ |
| PointSpreadLoading | ✅ | ✅ | ✅ | ✅ |
| ThreeHorseLoading | ✅ | ✅ | ✅ | ✅ |
| PassThrouthLoading | ✅ | ✅ | ✅ | ✅ |
| CoffeeLoading | ✅ | ✅ | ✅ | ✅ |
| BatteryLoading | ✅ | ✅ | ✅ | ✅ |
| DiamonLoading | ✅ | ✅ | 🔨 | ✅ |
| EatLoading | ✅ | ✅ | 🔨 | ✅ |
首次运行项目
$ git clone https://github.com/sixiaodong123/react-loading
$ npm run devP.S.: 若启动不成功,请先安装yarn
npm install -g yarn二次项目运行
npm run storybook$ npm run build$ npm run release- perf: 优化相关,比如提升性能、体验
- feat: 新功能(feature)
- fix: 修补 bug
- docs: 文档(documentation)
- style: 格式(不影响代码运行的变动)
- refactor: 重构(即不是新增功能,也不是修改 bug 的代码变动)
- test: 增加测试
- chore: 构建过程或辅助工具的变动
- upgrade: 第三方库升级
- revert: 回滚
- scope: commit 影响的范围, 比如: route, component, utils, build...
- merge: Merge branch ? of ?.
- 模块功能开发(feature/xxx)
- Bug 修改(bug/xxx)
试试react-loading-demand,或者用下面这种方式来按需加载
import BabelLoading from 'react-loadingg/lib/BabelLoading'