@ray-js/smart-ui
Version:
轻量、可靠的智能小程序 UI 组件库
89 lines (68 loc) • 2.72 kB
Markdown
<!-- ---
category: 展示
--- -->
进度条
```jsx
import { Progress } from '@ray-js/smart-ui';
```
```jsx
import React from 'react';
import { Progress } from '@ray-js/smart-ui';
export default function Demo() {
return (
<Progress
percentage={70}
color="linear-gradient(to right, #FA709A 0%, #FEDD44 100%)"
/>
);
}
```
```jsx
<Progress.Circle percent={20} />
```
<!-- prettier-ignore -->
| 参数 | 说明 | 类型 | 默认值 |
| ------------ | -------------------------- | ------------------ | ---------------- |
| color | 进度条颜色 | _string_ | `
| inactive | 是否置灰 | _boolean_ | `false` |
| percentage | 进度百分比 | _number_ | `0` |
| pivotColor | 文字背景色 | _string_ | 与进度条颜色一致 |
| pivotText | 文字显示 | _string_ | 百分比文字 |
| showPivot | 是否显示进度文字 | _boolean_ | `true` |
| strokeWidth | 进度条粗细,默认单位为`px` | _string \| number_ | `4px` |
| textColor | 进度文字颜色 | _string_ | `
| trackColor | 轨道颜色 | _string_ | `
<!-- prettier-ignore -->
| 属性名 | 描述 | 类型 | 默认值 |
| ------ | ---- | ---- | ------ |
className|类名|string|undefined|
children|子元素|ReactNode|undefined|
style|样式|CSSProperties|undefined|
size|尺寸|string|'100px'|
trackWidth|滑槽宽度|string|'10px'|
trackColor|滑槽颜色|string|'#d3d3d3'|
fillColor|填充颜色|string|'#007AFF'|
percent|百分比|number|0|
maskColor|遮罩颜色|string|'#ffffff'|
组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](/material/smartui?comId=config-provider)。
| 名称 | 默认值 | 描述 |
| --------------------------------- | --------- | ---- |
| --progress-height | _4px_ | - |
| --progress-background-color | _
| --progress-pivot-padding | _0 5px_ | - |
| --progress-color | _
| --progress-pivot-font-size | _10px_ | - |
| --progress-pivot-line-height | _1.6_ | - |
| --progress-pivot-background-color | _
| --progress-pivot-text-color | _
| --circle-text-color | _