Skip to content
API/getAriaSort

getAriaSort

src/utils/get-aria-sort.tsfunction
getAriaSort(sorts: readonly Sort[], field: string): AriaSort

The aria-sort value for a column header.

Only the primary sort reports a direction — ARIA allows one sorted column per table — so every other column, sorted or not, is 'none'.

Parameter Type Description
sorts readonly Sort[] The current sorts
field string The column’s API field

Returns — 'ascending', 'descending' or 'none'