Metrics

Use metrics to illustrate a fact that is concise and easy to consume. Avoid metrics that require footnotes, detailed explanations, or are very specific. Keep the text associated with a metric to just a few words to ensure that metrics are easy to skim.


Overview

Here’s an example metric:

3.14Value of pi

On their own, metrics take up the full width of the page on desktop browsers. A more typical use case is to place metrics in columns:

98%Success rate
B+Average letter grade
16:9Typical aspect ratio

Metrics can also be floated left or right. Floated metrics are narrower, taking up about a third of the page width on desktop browsers.

Metrics have a light grey background by default. They also have a dark style, a clear style (dark text on transparent background), and an overlay style (light text on transparent background). The overlay style can be useful for situations where a metric may appear over an image or other background:

$1MAnnual budget
#4U.S. News rating
16KIndividual donors

The size of metric text will scale as necessary for larger numbers, or if the metric becomes constrained in columns or on a mobile device. Generally, though, more concise metrics work best. Consider the following:

7,800,000,000Global population
7.8BGlobal population

Adding a Metric

On sites using the Block Editor, metrics (Metric block editor icon) can be added from the block library, under the Component Library section. Metric content can be edited directly, and options can be set in the sidebar.

On sites using the older Visual Editor, metrics can be added by choosing the Metric pictograph (Metric WYSIWYG toolbar icon) from the editor’s toolbar. Use the editor dialogue to add content and adjust options. To edit the metric later, double-click the metric preview to show the editor dialogue again.


Technical Details

Metrics can be implemented with the shortcode cl-metric.

[cl-date date="July 4" caption="Independence Day"]

Attributes

metric

(string) (required)

The text for the metric

caption

(string) (optional)

The text for the caption

style

(string) (optional) (values: dark, clear, overlay)

Set the style of the metric

(default value: none)

float

(string) (optional) (values: left, right)

Set to float the metric either left or right

(default value: none)

class

(string) (optional)

Set custom CSS class(es)

(default value: none)