Skip to main content

indicatorBox: a filled box for a yes

AFC, 2024
TeamWon week 18
KC
LAC
DEN
LV
BUF
MIA
NYJ
NE
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// truthy lists the values that fill the box; everything else gets the neutral box.
const spec = defineTable<Standing>()
.columns((c) => [c.text("team"), c.indicatorBox("result_last", { label: "Won week 18", truthy: ["W"] })])
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: kind · indicatorBox · gt_indicator_boxes. All sdvtables examples.