Skip to main content

This is a draft (version 0.5.0). The National Information Technology Agency (NITA) plans to make GGDS official guidance for government websites after independent accessibility testing. What this means

Ghana Government Design System Design system for Government of Ghana websites – home Search

Content

Meter

An amount drawn as a bar, so people can compare rows of a table at a glance: a chart that is still a table.

When to use

  • In a table, to compare one amount across rows: rainfall by region, applications by office.
  • For how full something is, such as places left at a session.

When not to use

  • On its own, without the number in words next to it.
  • For progress through a task: use progress.
  • For data that needs a real chart, such as a trend over time: show the table, and a chart image with a text description.

How to use

  • Put the number in its own cell, then the meter in the next. The number is what people read; the bar is for comparing.
  • Use a native <meter> with min, max and value: no style attributes, so it works under a strict Content Security Policy.
  • Use the same max on every row, a round number just above the largest value, so the bars compare fairly.
  • Hide the meter from screen readers with aria-hidden="true": the number in the table says it already.
  • Say the unit in the table’s caption or column heading.

Do

  • Show the number next to every bar.
  • Use one scale for the whole table.

Don't

  • Start the scale above zero: it exaggerates differences.

Accessibility

What GGDS does

  • The meter is a native element, drawn in the institution’s colour, with no script.
  • In Windows contrast themes it keeps an outline.

What you need to do

  • Keep the number in text next to the meter (WCAG 1.1.1 and 1.4.1).
  • Hide the meter from screen readers, so the number is not read twice.

Example: Meters in a table

Open this example on its own page

HTML code for “Meters in a table”
HTML
<div class="ggds-table-wrap" role="region" aria-labelledby="rain-caption" tabindex="0">
  <table class="ggds-table">
    <caption class="ggds-table__caption" id="rain-caption">Rainfall by region, April to July 2026, in millimetres</caption>
    <thead>
      <tr>
        <th scope="col">Region</th>
        <th scope="col" class="ggds-table__numeric">Rainfall</th>
        <th scope="col"><span class="ggds-visually-hidden">Rainfall as a bar</span></th>
        <th scope="col" class="ggds-table__numeric">Normal</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">Western</th>
        <td class="ggds-table__numeric">1020</td>
        <td><meter class="ggds-meter" min="0" max="1100" value="1020" aria-hidden="true">1020 mm</meter></td>
        <td class="ggds-table__numeric">880</td>
      </tr>
      <tr>
        <th scope="row">Volta</th>
        <td class="ggds-table__numeric">812</td>
        <td><meter class="ggds-meter" min="0" max="1100" value="812" aria-hidden="true">812 mm</meter></td>
        <td class="ggds-table__numeric">700</td>
      </tr>
      <tr>
        <th scope="row">Ashanti</th>
        <td class="ggds-table__numeric">744</td>
        <td><meter class="ggds-meter" min="0" max="1100" value="744" aria-hidden="true">744 mm</meter></td>
        <td class="ggds-table__numeric">770</td>
      </tr>
      <tr>
        <th scope="row">Greater Accra</th>
        <td class="ggds-table__numeric">512</td>
        <td><meter class="ggds-meter" min="0" max="1100" value="512" aria-hidden="true">512 mm</meter></td>
        <td class="ggds-table__numeric">430</td>
      </tr>
    </tbody>
  </table>
</div>
<p class="ggds-hint">Example figures only.</p>
JSX (React)
<>
  <div className="ggds-table-wrap" role="region" aria-labelledby="rain-caption" tabIndex={0}>
    <table className="ggds-table">
      <caption className="ggds-table__caption" id="rain-caption">Rainfall by region, April to July 2026, in millimetres</caption>
      <thead>
        <tr>
          <th scope="col">Region</th>
          <th scope="col" className="ggds-table__numeric">Rainfall</th>
          <th scope="col"><span className="ggds-visually-hidden">Rainfall as a bar</span></th>
          <th scope="col" className="ggds-table__numeric">Normal</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">Western</th>
          <td className="ggds-table__numeric">1020</td>
          <td><meter className="ggds-meter" min="0" max="1100" value="1020" aria-hidden="true">1020 mm</meter></td>
          <td className="ggds-table__numeric">880</td>
        </tr>
        <tr>
          <th scope="row">Volta</th>
          <td className="ggds-table__numeric">812</td>
          <td><meter className="ggds-meter" min="0" max="1100" value="812" aria-hidden="true">812 mm</meter></td>
          <td className="ggds-table__numeric">700</td>
        </tr>
        <tr>
          <th scope="row">Ashanti</th>
          <td className="ggds-table__numeric">744</td>
          <td><meter className="ggds-meter" min="0" max="1100" value="744" aria-hidden="true">744 mm</meter></td>
          <td className="ggds-table__numeric">770</td>
        </tr>
        <tr>
          <th scope="row">Greater Accra</th>
          <td className="ggds-table__numeric">512</td>
          <td><meter className="ggds-meter" min="0" max="1100" value="512" aria-hidden="true">512 mm</meter></td>
          <td className="ggds-table__numeric">430</td>
        </tr>
      </tbody>
    </table>
  </div>
  <p className="ggds-hint">Example figures only.</p>
</>

Use it

Stylesheet
ggds.css includes it. To load only the parts you use: core.css, then components/meter.css (0.3 KB with gzip, minified).
JavaScript
None needed.

HTML

Copy the HTML under each example above. It works in any website.

Astro

No Astro component: copy the HTML.

React and Next.js

With @ggds/react:

JavaScript
import { Meter } from '@ggds/react';

<td className="ggds-table__numeric">812</td>
<td><Meter value={812} max={1100} /></td>

Django

With ggds-django ({% load ggds %}):

Django template
{% ggds_meter region.rainfall max=1100 %}

Classes and states

Classes for meter
ClassWhat it does
.ggds-meterThe bar: a native <meter> with min, max and value, in the institution’s colour.

Accessibility tests

Automated, on every change

These run each time GGDS changes. A change that fails one is not accepted.

  • WCAG 2.2 A and AA rules (axe), at desktop and phone widths, on every example
  • No sideways scrolling on a 320px screen, also with a wide font, on every example
  • Every approved colour pair meets its contrast minimum, for every institution theme
  • No inline scripts or styles, so it runs under a strict Content Security Policy

By people, with assistive technology

Automated tests find only some of the barriers people meet. These checks are still to be done.

Manual accessibility checks for meter
CheckResultNotes
Keyboard onlyNot tested yetWaiting for the external audit with disabled people (decision D-09).
NVDA screen reader with Firefox or Chrome (Windows)Not tested yetWaiting for the external audit with disabled people (decision D-09).
JAWS screen reader with Chrome (Windows)Not tested yetWaiting for the external audit with disabled people (decision D-09).
VoiceOver screen reader with Safari (iPhone)Not tested yetWaiting for the external audit with disabled people (decision D-09).
TalkBack screen reader with Chrome (Android)Not tested yetWaiting for the external audit with disabled people (decision D-09).
Zoom to 400%, and increased text spacingNot tested yetWaiting for the external audit with disabled people (decision D-09).
Windows contrast themes (forced colours)Not tested yetWaiting for the external audit with disabled people (decision D-09).
Voice control (Voice Access or Dragon)Not tested yetWaiting for the external audit with disabled people (decision D-09).

Changes

Changes to meter, newest first
VersionChange
0.3.0New: meter, an amount as a bar in a table, so a table is also a chart; a native <meter>, hidden from screen readers because the number is next to it.
0.1.0Added.

Every change, in What’s new

  • Table

    Tables for data people need to compare, such as fees or opening hours.

  • Key figures

    The few numbers that matter most on a page, each with what it measures, large enough to take in at a glance.

  • Progress

    Shows people how far through a task they are, such as “Question 3 of 4”, in words and as a bar.

Back to top

Something wrong, unclear or missing? Report a problem with this page or suggest a change to it on GitHub. You need a GitHub account.