--- title: "Custom Columns | Features" description: "Custom columns allow you to override or extend ZingGrid’s default cell behavior. You can use Slotted Tokens, Slotted Row/Card Content, Renderer, registerCellType, etc. to customize your columns." url: https://www.zinggrid.com/docs/features/custom-columns --- ```text experiment_id: web-retrieval-v1 fixture_id: /docs/features/custom-columns.md mode: provenance representation: markdown origin_response_id: 36d7e04fd909622ed7d7621abea95c1a version: 2026-10-21 version_created_at_utc: 2026-10-21T20:42:35.681Z version_nonce: ce641e05e5653141914f7f5979bbf7a6 generated_at_utc: 2026-11-08T23:36:16.643Z response_nonce: 71cc92c40fa3ddc56be6194c3c9c6c97 ``` # Custom Columns Custom columns allow you to override or extend ZingGrid’s default cell behavior. You can achieve this via Slotted Tokens, Slotted Row/Card Content, `renderer`, and `registerCellType`. ## Slotted Tokens You can format column data by adding slotted data (e.g., a `` tag) to ``. ZingGrid has two interchangeable tokens, `index` and `record`, that you can use to access any data key from your grid using `index.key` or `record.key`, like so: ```html [[index.branch]] - [[index.commitId]] - [[record.runTime]] ``` ### Slotted Tokens Grid Here is a complete grid which utilizes `index.key` and `record.key` to access slotted data: [Example code](https://app.zingsoft.com/demos/embed/9UDC77FH) ## Slotted Row Content Directly put markup in a cell with the `type` attribute, like so: ```html ``` ### Slotted Row Content Grid Here is a complete grid with markup as slotted row content: [Example code](https://app.zingsoft.com/demos/embed/OSZBFB5M) ## Slotted Card Content You can also directly put markup in the card mode of the grid with the `` tag, like so: ```html

Pipeline Information

Status: [[record.status]]
Branch: [[record.branch]]
Run Time: [[record.runTime]]
Commit: [[record.status]]
Username: [[record.status]]
``` > **Note:** In this case, we don't define any `` tags because we are only displaying card mode. ### Slotted Card Grid Here is a complete grid with slotted content in card mode: [Example code](https://app.zingsoft.com/demos/embed/RDLH5MJX) ## `renderer` Function You can use a custom renderer function to add actions on each cell (see below). Default arguments to the renderer function are indices that reference the cell. For example, if you have `index="branch, username"`, the function definition will be `function(branch,username,$cell)`. In the callback, you have direct access to the `` DOM contents through `$cell.dom()` and direct information related to the row through `$cell.record`. ```javascript function addChangeEvent(customIndex, $cell) { // $cell.record gives us us direct information related to this row const record = $cell.record; // $cell.dom() gives us direct access to zg-cell DOM contents const selectRef = $cell.dom().querySelector('select'); selectRef.addEventListener('change', e => { const changeValue = e.target.value; if (changeValue == 1) alert(`Restarting pipeline on branch: ${record.branch}-${record.commitId}`); else alert('Resetting cache'); }); } ``` > **Warning:** Only attempt to bind events to contents of `` and not the tag itself! The code snippet above does not break any rules because it binds an event to the `