TreeListRowProps

The props that the TreeList passes to the TreeListRow component when creating it. Accessible during the rowRender callback of the TreeList.

NameTypeDefaultDescription

ariaPosInSet?

number

The index of the item on current level, applied to the aria-posinset attribute.

ariaRowIndex?

number

The index to be applied to the aria-rowindex attribute.

ariaSetSize?

number

The count of items on current level, applied to the aria-setsize attribute.

dataItem

any

The data object that represents the current row.

expanded

boolean

The expanded state of the row. Useful for applying aria-expanded accessibility attribute.

isSelected

boolean

Indicates if the row is selected.

level

number[]

An array of indexes of each parent and current item in the data tree.

onClick?

any

The event that is fired when the row is clicked.

onContextMenu?

any

The event that is fired when the row context menu is triggered.

onDoubleClick?

any

The event that is fired when the row is double clicked.

onDrag?

(event: { dragged: number[]; draggedItem: any; draggedOver: "null" | number[]; nativeEvent: any; }) => void

Fires when a row is dragged.

onDrop?

(event: { dragged: number[]; draggedItem: any; draggedOver: "null" | number[]; nativeEvent: any; }) => void

Fires when a row is dragged and dropped.

render?

(row: ReactElement<HTMLTableRowElement>, props: TreeListRowProps) => ReactNode

A function for overriding the default rendering of the row.

rowHeight?

number

Sets the height of the row.

rowIndex

number

The index of the row. Useful for applying aria-rowindex accessibility attribute.

selectedField?

string

The name of the field which will provide a Boolean representation of the selected state of the item.