iconSet: every icon, picked per row with iconRef
| Name | Icon |
|---|---|
| circle | 0 |
| square | 1 |
| diamond | 2 |
| star | 3 |
| triangle-up | 4 |
| triangle-down | 5 |
| arrow-up | 6 |
| arrow-down | 7 |
| arrow-right | 8 |
| check | 9 |
| xmark | 10 |
| minus | 11 |
| plus | 12 |
| heart | 13 |
import { defineTable } from "@sportsdataverse/sdvtables";
import { ICON_NAMES, renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
// ICON_NAMES lists the inline-SVG icons iconSet and iconAssign draw. iconRef reads each row's icon from a column, and
// iconPosition "over" shows the icon alone.
const icons = ICON_NAMES.map((name, i) => ({ name, i }));
const spec = defineTable<(typeof icons)[number]>()
.columns((c) => [
c.text("name", { label: "Name" }),
c.iconSet("i", {
label: "Icon",
iconRef: "name",
iconPosition: "over",
colors: ["#15607A"],
iconSize: 20,
}),
])
.build();
await renderHTMLAsync(spec, icons);
Tags: formatter · iconSet · icon_sets · reactablefmtr · ICON_NAMES. All sdvtables examples.