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.

Tip

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

Featurelightning-datatablelightning-tree-grid
Format columns by data typeYesYes
Custom data typesYesYes
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.

Note

See Also

Release Preview

This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.