Meters are a visually engaging way to communicate progress or measurements.
<script type="module">
import '@brightspace-ui/core/components/meter/meter-circle.js';
import '@brightspace-ui/core/components/meter/meter-linear.js';
import '@brightspace-ui/core/components/meter/meter-radial.js';
</script>
<d2l-meter-linear value="1" max="6" text="Activities"></d2l-meter-linear>
<d2l-meter-radial value="22" max="24" text="On Track"></d2l-meter-radial>
<d2l-meter-circle value="1" max="6"></d2l-meter-circle>
Note: these are referred to as "progress meters" on design.d2l.
- Use to show the completion or progress of an object
- Use to highlight important or critical measurements
- Use to provide feedback when a user completes an action that results in a change in data
- Don't use a lot of progress indicators on a single screen because they can overwhelm the user
- Don't use motion unless the data is the primary content on the screen
Linear meters show a horizontal progress bar.
<script type="module">
import '@brightspace-ui/core/components/meter/meter-linear.js';
</script>
<style>
d2l-meter-linear {
width: 170px;
}
</style>
<d2l-meter-linear value="8" max="10" text="Activities"></d2l-meter-linear>
<d2l-meter-linear value="8" max="10" text="Activities: {x/y}" percent></d2l-meter-linear>
<d2l-meter-linear value="8" max="10" text-inline text="Activities"></d2l-meter-linear>
value
(required, Number): Current number of completed units. A positive, non-zero number that is less than or equal tomax
.max
(Number, default:100
): Max number of units that are being measured by this meter. A positive, non-zero number.percent
(Boolean): Shows a percentage instead ofvalue/max
.text-inline
(Boolean): Keeps the meter to a single line.text
(String): Context information about what the meter is about. Adding one of the following between{}
(e.g.,{x/y}
) causes replacements:%
in the string will be replaced with percentage valuex/y
in the string will be replaced with fraction with the proper language support- DEPRECATED
x
in the string will be replaced withvalue
- DEPRECATED
y
in the string will be replaced withmax
text-hidden
(Boolean): Hides the text visually
Radial meters appear as a half circle. They have more visual weight than a linear meter and should only be used when the data is central to the user's task.
<script type="module">
import '@brightspace-ui/core/components/meter/meter-radial.js';
</script>
<d2l-meter-radial value="30" max="100"></d2l-meter-radial>
value
(required, Number): Current number of completed units. A positive, non-zero number that is less than or equal tomax
.max
(Number, default:100
): Max number of units that are being measured by this meter. A positive, non-zero number.percent
(Boolean): Shows a percentage instead ofvalue/max
.text
(String): Context information about what the meter is about. Adding one of the following between{}
(e.g.,{x/y}
) causes replacements:%
in the string will be replaced with percentage valuex/y
in the string will be replaced with fraction with the proper language support
text-hidden
(Boolean): Hides the text visually
Circle meters display data in a compact circle format, so they're useful when horizontal space is at a premium.
<script type="module">
import '@brightspace-ui/core/components/meter/meter-circle.js';
</script>
<d2l-meter-circle value="1" max="6"></d2l-meter-circle>
All meter
components have a foreground-light
style that ensures accessible contrast levels when displayed against a dark background.
<script type="module">
import '@brightspace-ui/core/components/meter/meter-linear.js';
import '@brightspace-ui/core/components/meter/meter-radial.js';
import '@brightspace-ui/core/components/meter/meter-circle.js';
</script>
<d2l-meter-linear value="1" max="6" foreground-light text="Activities"></d2l-meter-linear>
<d2l-meter-radial value="22" max="24" foreground-light text="On Track"></d2l-meter-radial>
<d2l-meter-circle value="1" max="6" foreground-light></d2l-meter-circle>
value
(required, Number): Current number of completed units. A positive, non-zero number that is less than or equal tomax
.max
(Number, default:100
): Max number of units that are being measured by this meter. A positive, non-zero number.percent
(Boolean): Shows a percentage instead ofvalue/max
.text
(String): Context information about what the meter is about. Adding one of the following between{}
(e.g.,{x/y}
) causes replacements:%
in the string will be replaced with percentage valuex/y
in the string will be replaced with fraction with the proper language support
text-hidden
(Boolean): Hides the text visually