Custom Columns
Use custom colums to render images (including svg's), add background colours etc. All input is auto sanitised using dompurify.
Import any SVG's #
import YourSvg from "./img.svg";
Custom Column options #
const options = {
customCols: [
{
Avatar:
'<div style="min-height:4em"> <img style="height:3em" decoding="async" src=${Avatar}></img></div'
},
{
Department: `<span style="position:relative; top:-0.3em;"> <img src=${YourSvg} style="width:1.5em;height:1.5em; position:relative; top:0.4em;" /> Dept </span>`
}
]
};
<Table json={json} options={options} />
The Tailwind example uses HeroIcons
https://codesandbox.io/s/custom-icon-label-columns-hxr8k
- Next: Booleans Columns
- Previous: Icon Columns