Progress
Show progress toward a known total.
Examples
Show progress toward a known total
React code
import { Label, Progress } from "@accelerate/react/components";
export function Example() {
return (
<>
<Label htmlFor="import-progress">Sample import progress</Label>
<Progress id="import-progress" max={100} value={65}>65%</Progress>
</>
);
}Angular code
import { Component } from "@angular/core";
import { AccLabel, AccProgress } from "@accelerate/angular/components";
@Component({
selector: "app-example",
imports: [
AccLabel,
AccProgress,
],
template: `
<label accLabel for="import-progress">Sample import progress</label>
<progress accProgress id="import-progress" max="100" value="65">65%</progress>
`,
})
export class Example {}Indeterminate progress
React code
import { Progress } from "@accelerate/react/components";
export function Example() {
return (
<>
<Progress aria-label="Checking file integrity"></Progress>
</>
);
}Angular code
import { Component } from "@angular/core";
import { AccProgress } from "@accelerate/angular/components";
@Component({
selector: "app-example",
imports: [
AccProgress,
],
template: `
<progress accProgress aria-label="Checking file integrity"></progress>
`,
})
export class Example {}Installation
Source preview. The expanded component catalog is ahead of the public npm releases. To run these examples in your own application, use packages built from the SDK source used for the previews or a release that includes the APIs below.
- React
@accelerate/ui@0.4.0and@accelerate/react@0.4.0- Angular
@accelerate/ui@0.4.0and@accelerate/angular@0.2.0
Load @accelerate/ui/theme.css and put acc-theme on the app or the region using Accelerator components. See the framework setup guide for the theme and adapter conventions.
Usage
Supply a label, value and max. Omit value for indeterminate progress.
Import the React component Progress from @accelerate/react/components. For Angular, add AccProgress to the standalone component’s imports and use <progress accProgress>.
Examples use these React parts: Label, Progress. The Angular examples show the corresponding directives and template hosts.
API reference
- value / max
- Set completed work and total work.
- Indeterminate
- Omit value when the total is unknown.