Skip to content

Table events

TypeDefault valueDescription
collapseAllHandleRefReact.RefObject<() => void>undefinedRef handle to collapse all expanded accordion rows. Send in a ref and use .current() to collapse all rows.

Table Row <Tr> events

Table Row <Tr> events are a part of the mode feature and needs to be enabled with the mode property on the main Table.

Table with navigation mode(mode="navigation") only supports the <Tr> event onClick.

Table with accordion mode(mode="accordion") supports all the <Tr> events listed below.

TypeDefault valueDescription
onClick(event, { trElement }) => voidundefinedWill emit when user clicks/expands or on keydown space/enter (in mode="accordion" and mode="navigation") in the table row. The second argument is an object with trElement (the HTMLTableRowElement).
onOpen({ target }) => voidundefinedWill emit when table row is expanded. Returns an object with the table row as the target: { target }.
onClose({ target }) => voidundefinedWill emit when table row is closed (after it was open). Returns an object with the table row as the target: { target }.

Table Data <Td> events

The <Td> onClick event renders a native <button> inside the cell for accessibility and provides element references in the second argument.

TypeDefault valueDescription
onClick(event, { trElement, tdElement, thElement, isSelected, setSelected }) => voidundefinedWill emit when user clicks the cell button. The second argument is an object with trElement (the parent HTMLTableRowElement), tdElement (the HTMLTableCellElement), thElement (the matching <Th> from <thead>, or null if not found), isSelected (current selected state), and setSelected (function to update the selected state — only effective when the selected prop is provided).
iconboolean
IconIcon
trueIcon to show in the clickable cell. Set to true for the default chevron icon, or pass a custom icon. Set to false to hide the icon. Only takes effect when onClick is provided.