Progress

The Progress component is designed to display the progress of a task that involves multiple steps and takes some time to complete. It helps users stay informed about the current status of a lengthy process.
Installation
API Reference
Spec Doc
This is an illustration of Progress component.
size
<Progress value={40} w={300} size="md">
<ProgressFilledTrack />
</Progress>

Installation

Step 1: Install the following dependencies:

npm i @gluestack-ui/progress

Step 2: Copy and paste the following code into your project.

import { styled } from "@gluestack-style/react"
import { createProgress } from "@gluestack-ui/progress"
import { View } from "react-native"
const StyledRoot = styled(
View,
{
bg: "$background300",
borderRadius: "$full",
w: "100%",
variants: {
size: {
xs: {
h: "$1",
_filledTrack: {
h: "$1",
},
},
sm: {
h: "$2",
_filledTrack: {
h: "$2",
},
},
md: {
h: "$3",
_filledTrack: {
h: "$3",
},
},
lg: {
h: "$4",
_filledTrack: {
h: "$4",
},
},
xl: {
h: "$5",
_filledTrack: {
h: "$5",
},
},
"2xl": {
h: "$6",
_filledTrack: {
h: "$6",
},
},
},
},
defaultProps: {
size: "md",
},
},
{
descendantStyle: ["_filledTrack"],
}
)
const StyledFilledTrack = styled(
View,
{
bg: "$primary500",
borderRadius: "$full",
},
{
ancestorStyle: ["_filledTrack"],
}
)
export const Progress = createProgress({
Root: StyledRoot,
FilledTrack: StyledFilledTrack,
})
export const ProgressFilledTrack = Progress.FilledTrack

Step 3: Update the import paths to match your project setup.

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
Descendants Styling Props Props to style child components.
Sx Prop
Description
_filledTrack
Prop to style ProgressFilledTrack Component

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.
Edit this page on GitHub