跳到主要内容

进度条 Progress

表示当前任务的进度。

安装使用​

import { TiProgress, TiCircleProgress } from '@titian-design/mobile-react';

用法示例​

基础用法
codesanbox
copy
code
设置进度条宽度
codesanbox
copy
code
修改颜色
codesanbox
copy
code
设置缓冲进度
codesanbox
copy
code
展示进度值
codesanbox
copy
code

TiProgress API​

属性 Properties​

名称类型是否必填默认值说明备注
sizenumber否72进度值大小-
valuenumber否0进度值,取值范围 0-100-
buffernumber否0缓冲值,取值范围 0-100-
showProgressboolean否false是否展示进度值,默认不展示-
colorstring否-进度条颜色,默认为主题色-
strokeWidthnumber否8进度条宽度,默认为 8px-
strokeColorstring否-进度条轨道颜色,默认为进度条值的 10%-
bufferBgColorstring否-进度条缓冲轨道颜色,默认为进度条值的 30%-
gradient-colorGradientColorstring否-进度条颜色为渐变色,需要设置 from 和 to, 为字符串时,直接添加到 background-image 上

GradientColor​

interface GradientColor {
from: string;
to: string;
}

可扩展样式名 External Class​

类名说明备注
extClass扩展样式类名-
textClass进度条文字扩展样式类名-

CSS 变量 CSS Variables​

变量默认值说明备注
--progress-margin-vtheme.spacing.gap.g2垂直方向外间距-
--progress-margin-htheme.spacing.gap.g0水平方向外间距-
--progress-height8px进度条高度-
--progress-radiustheme.borderRadius.r1圆角大小-
--progress-bar-colortheme.color.brand.1000进度条颜色-
--progress-bar-radiustheme.borderRadius.r1进度条圆角大小-
--progress-pivot-margin-lefttheme.spacing.gap.g2左侧外间距-
--progress-pivot-colortheme.color.brand.1000进度条进度值颜色-
--progress-pivot-font-sizetheme.fontSize.t4进度数字,字-
--progress-pivot-line-heighttheme.lineHeight.single.t4进度数字,行高-
--progress-pivot-font-weighttheme.fontWeight.regular进度数字,字重-

TiCircleProgress API​

属性 Properties​

名称类型是否必填默认值说明备注
sizenumber否72进度值大小-
valuenumber否0进度值,取值范围 0-100-
buffernumber否0缓冲值,取值范围 0-100-
showProgressboolean否false是否展示进度值,默认不展示-
colorstring否-进度条颜色,默认为主题色-
strokeWidthnumber否8进度条宽度,默认为 8px-
strokeColorstring否-进度条轨道颜色,默认为进度条值的 10%-
bufferBgColorstring否-进度条缓冲轨道颜色,默认为进度条值的 30%-
fontstring否-canvas font 属性-

属性 Properties​

类名说明备注
extClass扩展样式类名-