Skip to main content

  • Foundations
    • Border radius
    • Breakpoints
    • Colours
    • Colour scheme
    • Elevation
    • Focus and outline
    • Sizing and spacing
    • Layout
    • Motion
    • Typography
    • Z-index
  • Elements
    • Buttons
    • Code
    • Icons
    • Figure and caption
    • Forms
    • Links
    • Lists
    • Media
    • Tables
  • Components
    • Accordion
    • Alerts
    • Avatar
    • Blockquote
    • Breadcrumbs
    • Card
    • Chiplets
    • Details and summary
    • Dialog
    • Empty state
    • Stats
    • Global footer
    • Horizontal rule
    • Kanban
    • Key-value list
    • Meter
    • Objects
    • Pagination
    • Polka background
    • Post-it note
    • Progress
    • Speech bubbles
    • Status dot
    • Skeleton
    • Skip link
    • Spinner
    • Toggles
    • Tooltip
    • Webmentions
  • Patterns
    • Article header
    • Author card
    • App list and app sheet
    • Error page
    • Related posts
    • Search results
    • Utilities

John Peart

  • Search
  • Menu
John Peart

Meter

Scalar-value bar based on <progress>.

A bar that represents a scalar value within a known range — disk usage, battery level, vote count. Unlike <progress>, it's not about progress over time; it's a snapshot.

The native <meter> element colours itself automatically based on where the value falls relative to low, high and optimum.

Optimum (green)

82 GB

Suboptimum (yellow)

45 GB

Even-less-good (red)

12 GB
<label for="storage">Storage free</label>
<meter id="storage"
       value="82" min="0" max="100"
       low="30" high="80" optimum="100">
  82 GB
</meter>

Attribute summary

value
Current reading.
min / max
Range boundaries. Defaults to 0 / 1.
low / high
Define the bands that colour the bar.
optimum
Where the "best" value sits — the browser picks the colour accordingly.

When to use meter vs progress

Meter
A fixed capacity — how full something is right now.
Progress
An ongoing task — how far it's got toward completion.
A line drawing of John Peart

John Peart

www.johnpe.art

Mastodon logo

Mastodon

BlueSky logo

Bluesky

LinkedIn logo

LinkedIn

Github logo

GitHub