Stats
Anatomy
Usage Guidelines
Stats are handy when promoting several related data points. Stats can have a maximum of three items listed. If more are needed, consider using individual fact components arranged in a grid.
Accessibility
The heading at the beginning of each Stats component should have the correct heading level set for the page outline.
When adding values and labels to each item, think about how the wording will be read out by a screen reader and if it makes sense. Sometimes the visually larger number or other value may look fine, but may be confusing if audibly read.
WordPress
This component can be added to post content with the Stats block in the Gutenberg editor.
Recent Updates
Sprint 32 7/26/2022 When editing the stats component, if you leave the Heading Class field blank, the default class and styling that the header will get will be h3. To override this, add your desired heading class, h1, h2, h3, h4, h5, or h6. Adding one of those classes removes the default h3 class being applied and replaces it with you new class.
Specifications
Properties
Property | Type | Description | Required | Default |
---|---|---|---|---|
heading | string | Main heading text | Yes | - |
h_level | integer | Makes sure the title is the correct heading level for the page outline | No | 2 |
items | array | Makes sure the title is the correct heading level for the page outline. | Yes | - |
└ item | object | - | - | - |
└ value | string | - | Yes | - |
└ label | string | Display text | Yes | - |
class | string | list of additional classes to apply to main element. | No | - |
Styling
Custom Properties
Name | Default | Resets | Description |
---|---|---|---|
--tux-c-stats--value-color | var(--tux-theme--accent-color) | Yes | - |
Changelog
1.36.0 (2022-07-21)
- fix: use
h3
class only if another h level class is not used (36eca0d)
1.0.0
- stats added
Examples
Default
Cool Stats
Cookies, whenever you want
The best you'll find anywhere, trust us
Puzzle pieces all over the floor
{{ include( 'components/stats.twig', { heading: "Cool Stats" h_level: 2 items: {...} } ) }}
Different Heading Level
Cool Stats II
things that are 100% good
in family fun
We're all androids
{{ include( 'components/stats.twig', { heading: "Cool Stats II" h_level: 3 items: {...} } ) }}