Progress
A horizontal progress bar to indicate completion or loading progress.
The Progress component displays a horizontal bar that fills proportionally to represent a value between 0 and a configurable maximum. It is built with React Native View components and styled using NativeWind classes.
Preview
Installation
npx novaui-cli add progressImport
import { Progress } from 'novaui-components'Basic Usage
Pass a value prop to set the current progress. By default, the max is 100:
import { Progress } from 'novaui-components'
export function BasicProgress() {
return <Progress value={60} />
}Values
Zero Progress
An empty progress bar representing 0%:
<Progress value={0} />Partial Progress
A partially filled progress bar:
<Progress value={45} />Complete Progress
A fully filled progress bar:
<Progress value={100} />Custom Max Value
Set a custom maximum value for progress calculation:
<Progress value={3} max={5} />With Label
Display a progress bar with a text label showing the percentage:
import { View, Text } from 'react-native'
import { Progress } from 'novaui-components'
export function ProgressWithLabel() {
const value = 72
return (
<View className="gap-2">
<View className="flex-row justify-between">
<Text className="text-sm font-medium text-foreground">Uploading...</Text>
<Text className="text-sm text-muted-foreground">{value}%</Text>
</View>
<Progress value={value} />
</View>
)
}Props API
ProgressProps
Extends React.ComponentPropsWithoutRef<typeof View> and includes:
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | 0 | The current progress value |
max | number | 100 | The maximum value for progress calculation |
className | string | - | Additional CSS classes for the progress track |
Best Practices
-
Show context: Pair the progress bar with text labels to explain what is being loaded or completed.
-
Clamp values: The component automatically clamps values between 0 and
max, but validate inputs when possible. -
Avoid indeterminate use: This component represents determinate progress. For indeterminate loading, use
Spinnerinstead. -
Animate transitions: For smoother UX, consider animating the
valueprop changes with React Native'sAnimatedAPI. -
Accessible labels: Add
accessibilityLabelandaccessibilityValueprops for screen reader support.
Related Components
- Use
Spinnerfor indeterminate loading states - Combine with
TextorLabelfor progress descriptions - Pair with
Buttonfor upload or download actions