Progress
Determinate or indeterminate progress bar in four tones.
Example
import { Progress } from "@porcelana/ui";
export default function Example() {
return (
<div style={{ display: "grid", gap: 16, maxWidth: 420 }}>
<Progress label="Sync" value={72} />
<Progress label="Battery" value={38} tone="warning" />
<Progress label="Firmware update" value={null} />
</div>
);
}Import
import { Progress } from "@porcelana/ui";
import "@porcelana/ui/styles.css"; // once, at your app rootProps
Generated from the TypeScript types. Standard HTML attributes are passed through and not listed.
Progress
Pass `value={null}` for an indeterminate bar.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | – | Accessible name, e.g. "Upload progress". |
aria-label | string | – | Defines a string value that labels the current element. @see aria-labelledby. |
asChild | boolean | – | Render the single child element instead, merging props and behaviour onto it. |
getValueLabel | ((value: number, max: number) => string) | – | Builds aria-valuetext from (value, max). |
id | string | – | Element id. Generated automatically when omitted. |
max | number | 100 | Highest allowed value. |
tone | "primary" | "danger" | "success" | "warning" | primary | Bar color. |
value | number | null | – | Controlled value. Use with onValueChange. |
Accessibility
- role="progressbar" with a required label and aria-valuenow; value={null} means indeterminate.
- The animation stops when reduced motion is on.