Progress
Displays how far a task has got, as a bar.
import { Progress } from "@dapplelight/signet-ui/components/progress"
export function Demo() {
return <Progress value={64} aria-label="Storage used" />
}Installation
npm i @dapplelight/signet-uiUsage
import {
Progress,
ProgressLabel,
ProgressValue,
} from "@dapplelight/signet-ui/components/progress"
<Progress value={64} aria-label="Storage used" />Built on Base UI's Progress, so the root takes its props.
Examples
Label and value
Storage used
import { Progress, ProgressLabel, ProgressValue } from "@dapplelight/signet-ui/components/progress"
<Progress value={72}>
<ProgressLabel>Storage used</ProgressLabel>
<ProgressValue />
</Progress>Controlled
Uploading invoices
import { useState } from "react"
import { Progress, ProgressLabel, ProgressValue } from "@dapplelight/signet-ui/components/progress"
import { Button } from "@dapplelight/signet-ui/components/button"
const [value, setValue] = useState(30)
<Progress value={value}>
<ProgressLabel>Uploading invoices</ProgressLabel>
<ProgressValue />
</Progress>
<Button onClick={() => setValue((v) => (v >= 100 ? 0 : v + 25))}>Upload more</Button>Custom range
Onboarding steps
import { Progress, ProgressLabel, ProgressValue } from "@dapplelight/signet-ui/components/progress"
<Progress value={3} min={0} max={5}>
<ProgressLabel>Onboarding steps</ProgressLabel>
<ProgressValue>{(_, value) => `${value} of 5`}</ProgressValue>
</Progress>Indeterminate
Syncing orders
import { Progress, ProgressLabel } from "@dapplelight/signet-ui/components/progress"
<Progress value={null} aria-label="Syncing">
<ProgressLabel>Syncing orders</ProgressLabel>
</Progress>API Reference
Progress
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | null | required | Current value. null means indeterminate. |
| min | number | 0 | Lowest value. |
| max | number | 100 | Highest value. |
| format | Intl.NumberFormatOptions | - | How the value is formatted. |
| locale | Intl.LocalesArgument | browser | Locale for formatting the value. |
| getAriaValueText | (formatted, value) => string | - | Accessible value text. |
| className | string | - | Class on the root. |
| children | ReactNode | - | ProgressLabel and ProgressValue, shown above the bar. |
ProgressLabel
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Class on the label. |
ProgressValue
| Prop | Type | Default | Description |
|---|---|---|---|
| children | (formatted: string | null, value: number | null) => ReactNode | - | Custom text for the value. Defaults to the formatted percentage. |
| className | string | - | Class on the value. |
ProgressTrack / ProgressIndicator
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | The bar and its fill, already rendered by Progress. Export them to build your own. |