Progress Indicator for M3E
npm install @m3e/progress-indicatorm3e-linear-progress-indicator and m3e-circular-progress-indicator components provide accessible, animated progress indicators for tracking the completion of tasks or processes. Both components support multiple modes and are fully customizable via CSS custom properties.
bash
npm install @m3e/progress-indicator
`
๐ป Editor Integration
This package includes a Custom Elements Manifest to support enhanced editor tooling and developer experience.
$3
To enable autocomplete and hover documentation for @m3e/progress-indicator, install the Custom Elements Manifest Language Server extension. It will automatically detect the manifest bundled with this package and surface tag names, attributes, slots, and events in supported files.
Alternately, you can explicitly reference the html-custom-data.json and css-custom-data.json in your workspace settings:
`json
{
"html.customData": ["./node_modules/@m3e/progress-indicator/dist/html-custom-data.json"],
"css.customData": ["./node_modules/@m3e/progress-indicator/dist/css-custom-data.json"]
}
`
๐ Native Module Support
This package uses JavaScript Modules. To use it directly in a browser without a bundler, use a module script similar to the following.
`html
`
In addition, you must use an import map to include dependencies.
`html
`
> For production, use index.min.js for faster load times.
๐๏ธ Elements
- m3e-linear-progress-indicator โ A horizontal bar for indicating progress and activity.
- m3e-circular-progress-indicator โ A circular indicator of progress and activity.
๐งช Example
The following example illustrates determinate progress indicators.
`html
`
The next example illustrates indeterminate progress indicators.
`html
`
๐ API Reference
$3
This section details the attributes and CSS custom properties available for the m3e-linear-progress-indicator component.
#### โ๏ธ Attributes
| Attribute | Type | Default | Description |
| ------------ | --------------------------------------------------------- | --------------- | -------------------------------------------------------------------- |
| buffer-value | number | 0 | A fractional value, between 0 and max, indicating buffer progress. |
| max | number | 100 | The maximum progress value. |
| mode | "determinate" \| "indeterminate" \| "buffer" \| "query" | "determinate" | The mode of the progress bar. |
| value | number | 0 | A fractional value, between 0 and max, indicating progress. |
#### ๐๏ธ CSS Custom Properties
| Property | Description |
| --------------------------------------------------------------- | ----------------------------------------------------- |
| --m3e-linear-progress-indicator-thickness | Thickness (height) of the progress bar. |
| --m3e-linear-progress-indicator-shape | Border radius of the progress bar. |
| --m3e-progress-indicator-track-color | Track color of the progress bar (background/buffer). |
| --m3e-progress-indicator-color | Color of the progress indicator (foreground). |
| --m3e-linear-wavy-progress-indicator-amplitude | Amplitude of the wavy variant. |
| --m3e-linear-wavy-progress-indicator-wavelength | Wavelength of the wavy variant. |
| --m3e-linear-wavy-indeterminate-progress-indicator-wavelength | Wavelength of the indeterminate/query wavy variant. |
$3
This section details the attributes, slots, and CSS custom properties available for the m3e-circular-progress-indicator component.
#### โ๏ธ Attributes
| Attribute | Type | Default | Description |
| ------------- | --------- | ------- | ------------------------------------------------------------------ |
| indeterminate | boolean | false | Whether to show something is happening without conveying progress. |
| max | number | 100 | The maximum progress value. |
| value | number | 0 | A fractional value, between 0 and max, indicating progress. |
#### ๐งฉ Slots
| Slot | Description |
| ----------- | -------------------------------------------------- |
| _(default)_ | Renders the content inside the progress indicator. |
#### ๐๏ธ CSS Custom Properties
| Property | Description |
| --------------------------------------------------- | --------------------------------------------------- |
| --m3e-circular-flat-progress-indicator-diameter | Diameter of the flat variant. |
| --m3e-circular-wavy-progress-indicator-diameter | Diameter of the wavy variant. |
| --m3e-circular-wavy-progress-indicator-amplitude | Amplitude of the wavy variant. |
| --m3e-circular-wavy-progress-indicator-wavelength | Wavelength of the wavy variant. |
| --m3e-circular-progress-indicator-thickness | Thickness of the progress indicator. |
| --m3e-progress-indicator-track-color | Track color of the progress indicator (background). |
| --m3e-progress-indicator-color | Color of the progress indicator (foreground). |
๐ค Contributing
See the root monorepo CONTRIBUTING.md` for guidelines on contributing to this package.