You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An `<sp-meter>` is a visual representation of a quantity or achievement. The meter's progress is determined by user actions, rather than system actions.
4
4
5
-
### Installation
5
+
### Usage
6
6
7
7
[](https://www.npmjs.com/package/@spectrum-web-components/meter)
8
8
[](https://bundlephobia.com/result?p=@spectrum-web-components/meter)
9
9
[](https://webcomponents.dev/edit/collection/fO75441E1Q5ZlI0e9pgq/NqxNiDV1LXR9zxzocoRh/src/index.ts)
10
10
11
-
```
11
+
```bash
12
12
yarn add @spectrum-web-components/meter
13
13
```
14
14
15
15
Import the side-effectful registration of `<sp-meter>` via:
The negative variant can be used to warn users about a critical situation that needs their urgent attention, such as when space remaining is becoming very limited.
95
130
Use value `variant="negative"` to define a negative variant.
@@ -98,10 +133,29 @@ Use value `variant="negative"` to define a negative variant.
A meter can be delivered with its labeling displayed above its visual indicator or to either side. Use the boolean `[side-label]` attribute to define where this content should appear.
141
+
A meter can be delivered with its labeling displayed above its visual indicator or to either side. Use the boolean `side-label` attribute to define where this content should appear.
The `<sp-meter>` element is rendered with `role="meter progressbar"` to ensure proper semantics for assistive technologies. The current progress value is set as a percentager via the `progress` attribute and is exposed to assistive technology via `aria-valuenow`.
A meter is required to have either a visible text label or a `label` attribute.
158
+
159
+
#### Don't override color
160
+
161
+
The meter's variants provide semantic meaning through both color and ARIA attributes, ensuring that information is not conveyed through color alone. The progress track and fill maintain sufficient contrast for visibility.
0 commit comments