Progress
A linear progress row built on TxProgressBar.
Usage
States
status sets the status color.
Loading demo...
Progress Row
Loading demo...
Custom Text
<template>
<TuffProgress :percentage="42" :format="value => `Done ${value}%`" />
</template>
Indeterminate
<template>
<TuffProgress indeterminate :percentage="60" :show-text="false" />
</template>
Best Practices
- Use
TuffProgressfor simple row progress; useTxProgressBardirectly for segments, tooltips, messages, loading/success/error states, flow effects, or custom text placement. - Keep
strokeWidthmodest; this component is for row-level progress, not hero metrics. - For work of unknown duration, use
indeterminateand hide the text unless the value is trustworthy; never show a stale percentage. - Pair the bar with a short status label when the surrounding UI needs operational context.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
percentage | number | 0 | Determinate progress value. |
status | 'success' | 'error' | 'warning' | '' | '' | Status color. |
strokeWidth | number | 6 | Bar height in px. |
showText | boolean | true | Shows the text outside the bar. |
indeterminate | boolean | false | Indeterminate mode. |
format | (percentage: number) => string | - | Custom text for determinate progress. |
Overview
- It renders
TxProgressBarwith no wrapper DOM and forwardspercentage,status,indeterminate,showText, andformatas-is. strokeWidthbecomesheight(such as"6px"); text placement is fixed tooutsideand the mask tomaskVariant="plain".- It emits no events and has no slots; the host drives progress by updating props.
- Determinate progress gets
role="progressbar"andaria-valuenowfromTxProgressBar; indeterminate progress omitsaria-valuenow.
Technologies
- The install entry registers the component name
TuffProgress. - Source:
packages/tuffex/packages/components/src/progress/.
查看源码
packages/tuffex/packages/components/src/progress/index.ts