React Native / Feedback
ProgressBar
Linear progress. Reports its value to screen readers; the indeterminate bar respects Reduce Motion.
import { ProgressBar } from "@stylhero/native";
Example
import { ProgressBar, Stack } from "@stylhero/native";
function ProgressBarExample() {
return (
<Stack gap={4}>
<ProgressBar label="Uploading" value={0.6} showValue />
<ProgressBar label="Checking compatibility" />
</Stack>
);
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label required |
string |
- | What is in progress, e.g. "Uploading photos". Shown above the bar and read by screen readers. |
hideLabel |
boolean |
- | Hide the visible label (screen readers still get it). |
showValue |
boolean |
- | Show the percentage next to the label. Default true when value is set. |
style |
StyleProp<ViewStyle> |
- | |
testID |
string |
- | |
tone |
"primary" | "success" | "danger" |
"primary" |
|
value |
number |
- | Progress from 0 to 1. Leave it out while the amount of work is unknown (indeterminate). |
Accessibility
- A progress bar with its value as a percentage; without
valueit's indeterminate. - The indeterminate animation is skipped when Reduce Motion is on.
Generated from src/components/ProgressBar.tsx. Something wrong or missing? Open an issue.