Calm motion: animations on this site only fade, with no movement
Pictogram
A count as rows of icons, where one icon stands for a fixed number
Shows counts in a way that a general audience reads at once, for example people in each city. One icon stands for the same number in every row. For exact comparison, use the lollipop.
Basic
One icon = 1,000 listeners
- Jakarta8,400
- Bandung5,100
- Surabaya3,700
- Yogyakarta2,900
- Medan1,250
datais a list of items, each with alabel, avalue, and an optionalcolor.unitis the number that one icon stands for.nounnames what you count, for the line at the top, such as "One icon = 1,000 listeners".- The last icon of a row shows the rest. For example, 0.4 of an icon is 40% in color.
- The default icon is a person. Put your own SVG in the
iconslot to change it. - Set the size of an icon with the
--bless-picto-sizeCSS variable (default18px), and the width of the names with--bless-picto-label(default7rem). - The icons are hidden from screen readers, and each row says its name and its value.
labelnames the chart. Change the line at the top withlabelsor a label pack:key(a function of the unit and the noun).
Usage
ts
import { BlessPictogram } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
data* | BlessPictogramItem[] | — | |
unit* | number | — | what one icon stands for |
noun | string | "" | the name of what you count, for example "listeners" |
format | ((v: number) => string) | — | |
label | string | "Chart" | names the chart for screen readers |
labels | Partial<{ key: (unit: string, noun: string) => string; }> | — |
Slots
| Name | Scope | Description |
|---|---|---|
icon | — |