useTableRowIndex
@astryxdesign/core v0.7.1 · useTableRowIndex
Usage
Hook that returns a TablePlugin which prepends a right-aligned, monospaced row-number column. Numbering follows the rendered data order (reflecting the current sort / filter / pagination view) and starts at 1 by default. Astryx renderCell receives only the row item, so the plugin takes the rendered data array to derive each ordinal.
ts
import { useTableRowIndex } from '@astryx-vue/core/Table'Examples
useTableRowIndex — Numbered Rows
# | Title | Artist | Plays |
|---|---|---|---|
| 1 | Nightfall | Ava Chen | 1820 |
| 2 | Ember | Liam Park | 942 |
| 3 | Tidal | Zoe Vega | 3310 |
| 4 | Cinder | Max Ross | 604 |
| 5 | Halcyon | Mia Cole | 2075 |
A table with a prepended row-number column. Numbering is monospaced, right-aligned, and follows the rendered data order.