<div>
  <Button onClick={handleExpandClick}>
    {expandedItems.length === 0 ? 'Expand all' : 'Collapse all'}
  </Button>
</div>
<Box sx={{ minHeight: 352, minWidth: 250 }}>
  <RichTreeView
    items={MUI_X_PRODUCTS}
    expandedItems={expandedItems}
    onExpandedItemsChange={handleExpandedItemsChange}
  />
</Box>