Commentary
The infobox widget provides a display of timely and (optionally) actionable information. These are typically used in an administration page.
These infoboxes have 4 states:
- Default: generic information display;
- Primary: displayed data is important;
- Secondary: displayed data is useful;
- Tertiary: displayed data is for reminding.
The text area holds important information. Both sup
and sub
HTML tags are supported.
These can be used as a prefix or suffix for the numerical display. These elements should only be used for typographical
reasons; that is, to change the position of the text to comply with typographical conventions or standards.
These elements should not be used for presentation or appearance purposes.
Icons are supported. The span
holding the background icon
is wrapped in a div
that supplies the state colour and text colour for the icon. Alternatively,
the icon can be replaced by an img
HTML tag.
An optional footer region is available that is typically used to hold a call to action link.
An optional figcaption
HTML tag can be used to provide more descriptive text for a screen reader.
Usage
Classes: | |
---|---|
.infobox |
Defines the parent component for the simple infobox layout. |
.infobox-primary |
Optional modifier to indicate that data has some importants. |
.infobox-secondary |
Optional modifier to indicate that data is generally useful. |
.infobox-tertiary |
Optional modifier to indicate that data is mostly a reminder. |
Dependencies: | |
---|---|
File: | infobox.css |
Variables: | --bg-component, --indicator-right, --gap-col, --gap-row, --grey-dark, --margin-vert, --mar-horz, --pad-vert, --padding-medium, --mar-horz, --mar-vert, --radius-comp, --radius-elem, --radius-rounded, --primary, --primary-dark, --primary-light, --secondary, --secondary-dark, --secondary-light, --shadow, --size-3, --size-5, --tertiary, --tertiary-dark, --tertiary-light, --text-light, --text-invert, --weight-bold, --weight-semibold |
Examples
Infobox Default Layout
<figure class="infobox [infobox-primary infobox-secondary infobox-tertiary] ">
<figcaption class="sr-only">Default info box</figcaption>
<div>
<p>
<span>95<sup>%</sup></span>
<span>No Footer</span>
</p>
<div><span class="icon-bg-list"></span></div>
</div>
</figure>
Infobox Default Layout with Image and Footer
<figure class="infobox [infobox-primary infobox-secondary infobox-tertiary] ">
<figcaption class="sr-only">Info box with image and footer</figcaption>
<div>
<p>
<span>55<sup>%</sup></span>
<span>Economics</span>
</p>
<img src="https://zaphodbb-pm.github.io/goldilocks-css/img/demo/report-lion-head.jpg" alt="Lion Head Knocker" loading="lazy">
</div>
<a href="http://www.apple.com">
<span>More Info</span>
</a>
</figure>