Skip to content

Export ToolbarRoot to enable style reuse #23314

Description

@davidjb

Summary

Could ToolbarRoot (or its styles) from https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/components/toolbarV8/Toolbar.tsx be exported to enable reusing its styles elsewhere? As this file currently appears, it doesn't appear possible to access ToolbarRoot from outside, since only Toolbar is exported.

Examples

const ToolbarRoot = styled('div', {
name: 'MuiDataGrid',
slot: 'Toolbar',
})({
flex: '0 1 1px',
display: 'flex',
alignItems: 'center',
justifyContent: 'end',
gap: vars.spacing(0.25),
padding: vars.spacing(0.75),
minHeight: 52,
boxSizing: 'border-box',
borderBottom: `1px solid ${vars.colors.border.base}`,
});

Motivation

I'm displaying a Drawer alongside the DataGrid and wanted the drawer's header to appear identically to the Toolbar, without needing to copy-paste and keep the styles in sync between implementations.

Search keywords: ToolbarRoot

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: ToolbarRelated to the data grid Toolbar featurescope: data gridChanges related to the data grid.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions