Progress
Track task progression across multiple steps, keeping users updated on lengthy processes.
Installation
API Reference
This is an illustration of Progress component.
size
orientation
<Center className="w-[300px] h-[150px]"><Progress value={40} size="md" orientation="horizontal"><ProgressFilledTrack /></Progress></Center>
Installation
CLI
Manual
Run the following command:
npx gluestack-ui add progress
API Reference
To use this component in your project, include the following import statement in your file.
import { Progress, ProgressFilledTrack } from "@/components/ui/progress"
export default () => (<Progress><ProgressFilledTrack /></Progress>)
Component Props
This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.
Progress
It inherits all the properties of React Native's View component.
Prop | Type | Default | Description |
---|---|---|---|
value | number | - | It is used to set the progress of the progress bar |
ProgressFilledTrack
It also inherits all the properties of React Native's View component.
Accessibility
We have outlined the various features that ensure the Fab component is accessible to all users, including those with disabilities. These features help ensure that your application is inclusive and meets accessibility standards. Adheres to the WAI-ARIA design pattern.
Keyboard
- Tab: Moves focus to the next focusable element.
Screen Reader
- VoiceOver: When the Progress is focused, the screen reader will announce it's a progress and it's current progress indicator.
Props
Progress component is created using View component from react-native. It extends all the props supported by React Native View.
Progress
Name | Value | Default |
---|---|---|
size | xs | sm | md | lg | xl | 2xl | md |
orientation | vertical | horizontal | horizontal |
Important Note
Note: These props are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these props may not be available.
Examples
The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.
Value
Progress component with value
<VStack space="lg"><Text size="lg">Downloading 55%</Text><Progress value={55} className="w-80 h-1"><ProgressFilledTrack className="h-1" /></Progress></VStack>
Color
You can add track color to progress bar as per our needs.
<VStack space="3xl"><Progress value={46} className="w-96 h-2" size="sm"><ProgressFilledTrack className="bg-emerald-600" /></Progress><Progress value={46} className="w-96 h-2" size="sm"><ProgressFilledTrack className="bg-amber-600" /></Progress><Progress value={46} className="w-96 h-2" size="sm"><ProgressFilledTrack className="bg-fuchsia-600" /></Progress><Progress value={46} className="w-96 h-2" size="sm"><ProgressFilledTrack className="bg-cyan-600" /></Progress></VStack>
Custom
You can customize the progress bar. Below is the example where we have change the theme of progress bar.
<VStack space="lg"><Heading>Internal Storage</Heading><Progress value={46} className="w-[410px] h-2 bg-lime-100"><ProgressFilledTrack className="h-2 bg-lime-500" /></Progress><Text size="md">14GB</Text></VStack>