fast-progress
Progress and progress ring are used to display the length of time a process will take or to visualize percentage value (referred to as a determinate state) and to represent an unspecified wait time (referred to as an indeterminate state). Progress components are typically visually represented by a circular or linear animation. When the value
attribute is passed the state is determinate, otherwise it is indeterminate.
For progress components which have a linear visual appearance, use fast-progress
. For progress implementations which are circular, use fast-progress-ring
.
Setup
Basic Setup
import {
provideFASTDesignSystem,
fastProgress,
fastProgressRing
} from "@microsoft/fast-components";
provideFASTDesignSystem()
.register(
fastProgress(),
fastProgressRing()
);
Customizing Indicators
import {
provideFASTDesignSystem,
fastProgress,
fastProgressRing
} from "@microsoft/fast-components";
provideFASTDesignSystem()
.register(
fastProgress({
indeterminateIndicator1: `...your indeterminate indicator...`,
indeterminateIndicator2: `...your indeterminate indicator...`
}),
fastProgressRing({
indeterminateIndicator: `...your indeterminate indicator...`
})
);
Usage
fast-progress
Live Editor
<fast-progress min="0" max="100" value="75"></fast-progress>
Result
Loading...
fast-progress-ring
Live Editor
<fast-progress-ring min="0" max="100" value="75"></fast-progress-ring>
Result
Loading...
Create your own design
Progress
import {
BaseProgress as Progress,
ProgressOptions,
progressTemplate as template,
} from "@microsoft/fast-foundation";
import { progressStyles as styles } from "./my-progress.styles";
export const myProgress = Progress.compose<ProgressOptions>({
baseName: "progress",
template,
styles,
indeterminateIndicator1: `...default indeterminate indicator...`,
indeterminateIndicator2: `...default indeterminate indicator...`,
});
ProgressRing
import {
BaseProgress as ProgressRing,
ProgressRingOptions,
progressRingTemplate as template,
} from "@microsoft/fast-foundation";
import { progressRingStyles as styles } from "./my-progress-ring.styles";
export const myProgressRing = ProgressRing.compose<ProgressRingOptions>({
baseName: "progress-ring",
template,
styles,
indeterminateIndicator: `...default indeterminate indicator...`,
});
API
class: BaseProgress
Superclass
Name | Module | Package |
---|---|---|
FoundationElement | /src/foundation-element/foundation-element.js |
Fields
Name | Privacy | Type | Default | Description | Inherited From |
---|---|---|---|---|---|
value | public | number or null | The value of the progress | ||
min | public | number | The minimum value | ||
max | public | number | The maximum value | ||
paused | public | boolean | Indicates the progress is paused | ||
$presentation | public | ComponentPresentation or null | A property which resolves the ComponentPresentation instance for the current component. | FoundationElement | |
template | public | ElementViewTemplate or void or null | Sets the template of the element instance. When undefined, the element will attempt to resolve the template from the associated presentation or custom element definition. | FoundationElement | |
styles | public | ElementStyles or void or null | Sets the default styles for the element instance. When undefined, the element will attempt to resolve default styles from the associated presentation or custom element definition. | FoundationElement |
Methods
Name | Privacy | Description | Parameters | Return | Inherited From |
---|---|---|---|---|---|
templateChanged | protected | void | FoundationElement | ||
stylesChanged | protected | void | FoundationElement |
Attributes
Name | Field | Inherited From |
---|---|---|
value | ||
min | ||
max | ||
paused |
CSS Parts
Name | Description |
---|---|
progress | Represents the progress element |
determinate | The determinate indicator |
indeterminate | The indeterminate indicator |
Slots
Name | Description |
---|---|
indeterminate | The slot for a custom indeterminate indicator |