Progress
Displays a progress bar indicating task completion.
- Preview
- Code
Installation
- npm
- yarn
- pnpm
- bun
npm i @mangoui/progress
If @mangoui/react is already installed globally, you can skip this step.
Import
- Individual
- Global
import {ProgressRoot,ProgressIndicator,} from '@mangoui/progress';
- ProgressRoot: All parts of the progress are included.
- ProgressIndicator: Render the progress indicator. You can style it yourself.
Another way to import
'use client';import { Progress } from '@mangoui/progress';<Progress.Root value={30}><Progress.Indicator /></Progress.Root>;
'use client' must be used when rendering on the server side.
API Reference
ProgressRoot
All parts of the progress are included.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | - | It is the progress value. |
| max | number | 100 | This is the maximum progress value. |
| indeterminate | boolean | - | This means that progress is uncertain. |
| Data attribute | Values |
|---|---|
| [data-state] | "complete" | "loading" | "indeterminate" |
| [data-value] | The current value |
| [data-max] | The max value |
ProgressIndicator
Render the progress indicator. You can style it yourself.
| Data attribute | Values |
|---|---|
| [data-state] | "complete" | "loading" | "indeterminate" |
| [data-value] | The current value |
| [data-max] | The max value |
Examples
Indeterminate
<ProgressRoot indeterminate><ProgressIndicator /></ProgressRoot>
Custom Indicator
<ProgressRoot value={30}><ProgressIndicator style={{ backgroundColor: '#ff4d4f' }} /></ProgressRoot>
Max
<ProgressRoot value={100} max={200}><ProgressIndicator /></ProgressRoot>
Prev
Next