Skip to main content

spotlight: one row lit, the rest dimmed

AFC, 2024: Buffalo
TeamQbWinsLosses
Patrick Mahomes152
Justin Herbert116
Bo Nix107
Gardner Minshew413
Josh Allen134
Tua Tagovailoa89
Aaron Rodgers512
Drake Maye413
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

const spec = defineTable<Standing>()
.columns((c) => [c.logo("team", { league: "nfl" }), c.text("qb"), c.int("wins"), c.int("losses")])
.spotlight({ key: "team", op: "==", value: "BUF" }, { fill: "#E8EEF9", accentColor: "#00338D" })
.title("AFC, 2024: Buffalo")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: decoration · spotlight · gt_spotlight · predicate. All sdvtables examples.