2

I have made a custom toolbar

function CustomToolbar() {
  return (
    <GridToolbarContainer>
      <GridToolbarColumnsButton />
      <GridToolbarFilterButton />
      <GridToolbarDensitySelector />
      <GridToolbarExport />
    </GridToolbarContainer>
  )
}

But I'd like to change the names when displayed, not to be Columns, Filters, Density, Export, is there any solution?

Olivier Tassinari
  • 8,238
  • 4
  • 23
  • 23

1 Answers1

6

You can change the localeText prop of DataGrid/DataGridPro, see all the translation keys and its default values here:

<DataGrid
  {...data}
  localeText={{
    toolbarColumns: "my columns",
    toolbarFilters: "my filters",
    toolbarDensity: "my density",
    toolbarExport: "my export"
  }}
  components={{
    Toolbar: CustomToolbar
  }}
/>

Codesandbox Demo

NearHuscarl
  • 66,950
  • 18
  • 261
  • 230