Energy Label
The arrow a shop shows beside the price of a product that carries an EU energy label: the class of the product in the color the label gives it, the range of the scale beside it, a link from the arrow to the label and a link to the product information sheet. It follows what the energy labeling acts under Regulation (EU) 2017/1369 ask of a shop on the web, for a product card and a product page alike.
Basic Usage
efficiency is the class on the product's label, href the address of the label itself and sheet the address of its product information sheet.
Beside a Price
The class stands in the size of the price. Give the arrow the size of the price beside it, and place it right next to the price, where the acts ask for it.
Every Class
Each class takes the color of its place on the scale, from dark green for the best to red for the worst.
An Older Scale
Some product groups still carry a label of an older seven-class scale. scale names it by its two ends: A+++-D, A++-E or A+-F. The colors follow the place of the class on that scale.
The dash between the two ends may be any dash: the en dash a printed label shows (A–G), a minus sign or another dash from Unicode reads as the hyphen, and so does a space around it. Case does not matter either, so a scale stored as text in a product catalog can be passed as it is.
Pointing Left
The acts allow the arrow in two directions. direction="left" points it left and puts the range on its right, for a price that stands to the right of it.
In a Narrow Column
A label wider than its column wraps, and the link to the sheet moves below the arrow. On a touch screen the arrow takes a 44px target, and the rows of a wrapped label stand half a target apart, so the target never reaches the link below it.
Opening the Label
The acts ask that the label opens from the arrow on a click, a hover or a tap, as a pop-up, a new tab, a new page or an inset on the same page. href opens it as a new page. new-tab opens the label and the sheet in another tab instead, and each link then says so to a screen reader.
<x-wirekit::energy-label efficiency="B" :href="$product->energyLabelUrl" :sheet="$product->productSheetUrl" new-tab />
A class or a scale the label does not have is reported while you develop, and in production the arrow is left out rather than drawn with another class, since an arrow that names a class the product does not have tells a buyer something false about it.
What the Labeling Acts Ask For
The delegated regulations for each product group describe the arrow: in the color of the class, the class in white, in Calibri Bold and in the size of the price, the range of the scale in black, a black edge around the arrow and the letter, the letter centered in the rectangular part, pointing either way. The arrow asks for Calibri first and falls back to Carlito, its metric-compatible open counterpart, and then to the body face, where neither is installed. The colors are the CMYK values of the acts, converted to sRGB.
Two things stay with your shop:
- The label itself. The arrow only opens it. Link the label your supplier provides, or the one in the EU product database.
- Where it stands. Beside the price, on every page that shows the price, a product card included.
The tire label of Regulation (EU) 2020/740 has scales and colors of its own and is drawn by the tire label.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
efficiency |
string |
null |
The class on the product's label: A to G, or a class of the older scale named in scale, such as A+++ |
scale |
string |
'A-G' |
The scale of the label by its two ends: A-G, A+++-D, A++-E or A+-F, with any dash between them — see An Older Scale |
href |
string|null |
null |
The address of the label, an image or a PDF. The arrow links to it. Without it the arrow is an image only, and the label has to be shown in full elsewhere |
sheet |
string|null |
null |
The address of the product information sheet, linked as "Product information sheet" in the application's language |
size |
string |
'md' |
The size of the class, as on price: xs, sm, md, lg, xl |
direction |
string |
'right' |
Where the arrow points: right, with the range on its left, or left — see Pointing Left |
new-tab |
bool |
false |
Opens the label and the sheet in another tab |
scope |
string|null |
null |
Scoped personalization name |
Accessibility
- The arrow is an image, hidden from assistive technology. The link around it carries its meaning in words: "Energy efficiency class B on a scale from A to G. Show the energy label." Without
hrefthe same sentence stands in its place - The class is white with a black edge on its color, so it stays readable on the yellow and the light green of the middle classes, and the range is black on white
- The link to the product information sheet is visible text, in the words the acts prescribe for each language
- On a touch screen the arrow takes a 44px target that paints nothing, and a wrapped label keeps its rows half a target apart, so the target never takes a tap meant for the link below it
- Forced colors leave the arrow in its colors, as they leave a picture: the color is what the acts require it to show
- With
new-tabboth links announce that they open another tab
Keyboard Interaction
| Key | Action |
|---|---|
Tab / Shift+Tab |
Move to the arrow, then to the product information sheet |
Enter |
Open the label from the arrow, or the sheet from its link |
Both are links with the browser's own keyboard behavior.
Design Tokens
| Token | Used for |
|---|---|
--color-wk-energy-1 … --color-wk-energy-7 |
The color of the arrow, from the best class of a scale to the worst |
--text-wk-xs / --text-wk-sm / --text-wk-md / --text-wk-lg / --text-wk-xl |
The size of the class per size |
--font-wk-sans |
The range of the scale, and the class where neither Calibri nor Carlito is installed |
--gap-wk-sm / --gap-wk-xs |
The space between the arrow and the link to the sheet |