Skip to content
Calm motion: animations on this site only fade, with no movement

Waffle ​

Parts of a whole as a grid of 100 squares

Shows the share of each part as a count of squares. Each square is one percent, so "28 squares" reads as 28%. It is easier to compare than the slices of a pie. For a ring with the total in the middle, use the donut chart.

Basic
  • Spotify55.7% · 6,240
  • Apple Podcasts25.1% · 2,810
  • YouTube13.7% · 1,530
  • Other apps5.5% · 620
  • data is a list of parts. Each part has a label, a value, and an optional color (a token name or any CSS color).
  • The squares fill row by row from the top, one part after the other. The counts are whole numbers that add up to 100.
  • The legend shows the name, the share, and the value of each part. format sets the text of a value.
  • Set the size of a square with the --bless-waffle-cell CSS variable (default 14px).
  • For screen readers, the grid is hidden and the legend is a list. label names the chart.

Usage ​

ts
import { BlessWaffle } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
data*BlessWaffleSlice[]—
format((v: number) => string)—text for one value, for example `(v) => v + " GB"`
labelstring"Chart"names the chart for screen readers

Released under the MIT License. Character names and artwork belong to their owners.