Skip to content

Stats band

Stats band · sample rowOpen ↗

Renders StatsBand from @bison-lab/ui. The count, the order and the desktop column count are the editor’s. Phones show two per row and tablets three, whatever columns says; with an odd number of stats, wide names the one that takes a phone row to itself, and only a stat that starts a row (the 1st, 3rd or 5th) can. The array’s own validate says so as the editor builds, and publish refuses the same.

Overlap. With overlap on, the band floats across the join with the block above and the block below as a card. An overlapping band is headless: the heading fields leave the admin the moment the switch is on, and the renderer ignores them if they were filled in first. See the seam for what the neighbours do.

payload.config.ts / collections
import { StatsBandBlock } from "@bison-lab/payload-blocks";
// In the collection's `blocks` array:
StatsBandBlock
blocks/registry.ts
import { StatsBandBlockRenderer } from "@bison-lab/payload-blocks/react";
// In the site's registry:
statsBand: StatsBandBlockRenderer,
FieldTypeNotes
eyebrowtextSmall label above the heading. The heading and eyebrow are optional; without them the band stands alone.
titletext
descriptiontextarea
items *array2 to 6 rows. Opens with 2 empty rows; the admin field will not remove below that.
items[].value *textThe figure, as it should read: "98%", "12,000+", "L1–S1".
items[].label *textarea
items[].hreftextOptional. Makes the whole stat a link: a site path ("/outcomes") or a full URL.
items[].widecheckboxLabelled “Full width on phones”. Phones show two per row. With an odd number of stats, this one takes a row to itself. Only the 1st, 3rd or 5th stat can. Default false.
columnsselectFrom large screens up, and never more than there are stats. Phones show two per row and tablets three. One of 2, 3, 4, 5, 6. Default "4".
toneselectOne of card, plain. Default "card".
alignselectOne of start, center. Default "start".
overlapcheckboxLabelled “Float over the seam with the block above”. The band sits across the join between the block above and the block below. Both make room for it automatically. A floating band is headless: the heading fields above are hidden while this is on. Default false.

* required.