Back to Tamagui

Progress

code/tamagui.dev/data/docs/components/progress/1.0.0.mdx

1.144.41.5 KB
Original Source

Progress

<Description>Show percent completion with a progress bar</Description>

<HeroContainer showAnimationDriverControl> <ProgressDemo /> </HeroContainer>
tsx

<Highlights features={[ 'Sizable, themeable, animatable.', 'Compound component API for complete control.', <span> Adheres to the{' '} <a href="https://www.w3.org/TR/wai-aria-1.2/#progressbar"> progressbar role requirements </a> </span>, ]} />

Installation

Progress is already installed in tamagui, or you can install it independently:

bash
npm install @tamagui/progress

Usage

The value property controls the percent, but you can override it by adjusting the x property.

tsx
import { Button, Progress } from 'tamagui'

export default () => (
  <Progress value={60}>
    <Progress.Indicator animation="bouncy" />
  </Progress>
)

API Reference

Progress

Progress extends ThemeableStack, getting Tamagui standard props, plus:

<PropsTable data={[ { name: 'size', required: false, type: '"small" | "large"', }, { name: 'value', required: false, type: 'number | null', description: Control the percent progress., }, { name: 'max', required: false, type: 'number', }, ]} />

Progress.Indicator

Progress.Indicator extends ThemeableStack, getting Tamagui standard props.