Compare lightning-datatable and lightning-tree-grid for Data Display

These components are similar, but lightning-tree-grid has a chevron button that expands and collapses rows that have child records.

lightning-datatable uses the Data Tables blueprint from Salesforce Lightning Design System (SLDS) and provides an easy way to display your record data on desktop.

lightning-tree-grid uses the Tree Grid blueprint from SLDS and enables you to display hierarchical data, grouping records into parent-child relationships.

The Lightning Design System docs have examples of each component in different states.

Here’s a list of features supported by lightning-datatable and lightning-tree-grid.

Format columns by data typeYesYes
Header ActionsYesYes
Row ActionsYesYes
Resize ColumnsYesYes
Select RowsYesYes
Wrap or Clip Column ContentYesYes
Row NumbersYesYes
Column SortingYes-
Inline EditingYes-
Infinite ScrollingYes-
Expandable Rows-Yes

lightning-datatable and lightning-tree-grid aren’t supported on mobile devices.

See Also