• Stars
    star
    400
  • Rank 107,843 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💃 Look at me, I am a slim progress bar and very colorful / 支持彩色或单色的顶部进度条

Slim progress bars for anywhere you want to use

npm version package size download Build Status Coverage Status

简体中文 | English

Introduction

qier-progress is a progress bar. It can be used for some watting time like jump links, request data, and load or upload files and images to give us feedback and reduce our anxiety. Also if you have used nprogress, then you must know what I am talking about ~

💃check demo

Quick Start

🛠 Install

npm install --save qier-progress

📦 Use

Firstly, import module in Vue, React, Angular wherever es6 module is supported .

import QProgress from 'qier-progress'

Secondly, create instance.

const qprogress = new QProgress()

Thirdly, simply call start() and finish() to control the progress bar.

qprogress.start()
qprogress.finish()

Advanced usage

📌 Set progress value:

Use .set(n) to set a progress percentage, where is a number between 0..1 .

qprogress.set(0.0)     // same as .start()
qprogress.set(0.6)
qprogress.set(1.0)     // same as .finish()

🎢 Increase manually:

Use .inc(n) to increment the progress bar, but it will stop increasing after reaching the threshold, means it will never reach 100% .

qprogress.inc()
qprogress.inc(0.2)	// specific value you want

🥣 Forced finished:

Use .finish() to unmount the progress var, of course, there will also have an end process animation.

qprogress.finish()

🧮 Get current progress value:

Use .status to get current value  where is a number between 0..1 .

qprogress.status

Configuration

🤔 How to customize

When creating an instance, you can customize some parameters like this:

const qprogress = new QProgress({
  minimum: 0.08,
  height: 3,
  color: '#17829f'
})

📕 Configuration list

Parameter Description Type Default
minimum Minimum percentage used upon starting. number(0..1) 0.12
height Progress bar's height, unit is px . number 2
color Progress bar's color, support RGB. string '#1890ff'
colorful Colorful mode switch. boolean true
easing Css transition property time-function . string 'ease'
speed Css transition property duration , unit is ms . number 400
trickle Automatic incrementing behavior switch. boolean true
trickleSpeed Automatic incrementing speed, means increment interval, unit is ms . number 400
parentNode Specify this to change the parent container. Element | string 'body'

Contribution

Welcome to participate in this project, please read CONTRIBUTING carefully.

Inspiration and purpose

First of all, I am a beginner of typescript . When I enjoy the convenience brought by nprogress, I hope that I can learn a little bit from it, so I retyped this plugin using typescript  and added some other features. I learned a lot of coding knowledge in the process, and finally I sincerely thank the nprogress contributors very much, respect!

About me

Github.svg juejin-02.svg 哔哩哔哩.svg 知乎.svg

License

MIT

More Repositories

1

blog

📘 个人技术小文章,旨在对知识的总结,能帮助到别人就更好啦。
TypeScript
545
star
2

qier-player

🎬 A simple and easy-to-use h5 video player with highly customizable UI and rich features. / 简单易用的h5播放器,UI 高度定制化,功能丰富。
TypeScript
479
star
3

leetcode

🌱 Javascript solutions to problems on LeetCode
JavaScript
326
star
4

react-ts-quick-starter

🏗 Quickly create react + typescript project development environment and scaffold for developing npm package components
JavaScript
124
star
5

text-cursor-prompt

📝 根据文本框当前光标弹出提示框
JavaScript
18
star
6

tsccss

💅 Replace the .scss or .less suffix in the js file generated by tsc with .css
JavaScript
12
star
7

async-import-react-component

🌲 Allows you to load React components asynchronously from split chunks / 允许你异步地加载分割出的 React 组件
TypeScript
3
star
8

hover-seconds-do

⛵ Perform an action after an element has hovered for a few seconds
JavaScript
2
star
9

qier-cloud-music

🎶 移动端仿网易云播放器
JavaScript
2
star
10

better-axios

Better axios by Typescript
TypeScript
2
star
11

qier-player-demo

用于展示 qier-player demo的官网
JavaScript
2
star
12

node-learning

A learning example for NodeJS
JavaScript
2
star
13

jwt-test-demo

JavaScript
1
star
14

webpack-demo

webpack learning note
JavaScript
1
star
15

vortesnail

1
star
16

qier-text-cursor-popup

...
TypeScript
1
star
17

juejin-markdown-theme-pure

掘金 markdown 文章主题 pure(纯洁)
SCSS
1
star
18

YiYou-game-market

以Html+Css+简单的JS实现的仿小米商城布局的一个售卖单机游戏相关的商城
CSS
1
star
19

YUYU-Store

鱼鱼店官网
JavaScript
1
star
20

vue-travel

A simple vue app from immoc tutorial
JavaScript
1
star
21

dumi-debugging-speed-demo

dumi 本地启动太慢问题的复现仓库
TypeScript
1
star
22

What-is-5G-

关于5G的软科普网页
CSS
1
star
23

Express-CRUD

基于express框架的增删改查学生管理系统
HTML
1
star
24

sequelize-test-demo

Learn sequelize
JavaScript
1
star
25

slim-weibo

A simple application imitating Weibo by koa2
JavaScript
1
star
26

game-wow

游佳 - 游戏者的乐园
JavaScript
1
star
27

ManagerSystem-AntD

A demo for showing how to build a manager system with AntD..
JavaScript
1
star
28

qier-multi-react-cli

Support create react or react+ts project and react or react+ts npm package
1
star