Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] New Toolbar component #14611

Open
wants to merge 165 commits into
base: master
Choose a base branch
from

Conversation

KenanYusuf
Copy link
Member

@KenanYusuf KenanYusuf commented Sep 13, 2024

Adds a redesigned Toolbar component through a new composition API, documented here:

There are several related components that users can use to build a custom toolbar:

Note

This PR only adds the building blocks to create custom toolbars, and documentation for those components. I'm hoping we can release these in v7 for users to try out. There will be a follow up to update the default grid toolbar for v8 to use the new components. #15823

Closes #11584


Follow-up tasks:

  • Explore having an "overflow menu" for items that do not fit on the toolbar
  • Replace custom toolbar with the new experimental toolbar in the list view demo [DataGrid] List View #14393
  • Anchor filter panel and columns panel to triggers
  • Row grouping toolbar demo

@KenanYusuf KenanYusuf added component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer proof of concept Studying and/or experimenting with a to be validated approach labels Sep 13, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 18, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 1, 2024
---
title: React Data Grid - Toolbar component
productId: x-data-grid
components: ToolbarRoot, ToolbarButton
Copy link
Member Author

@KenanYusuf KenanYusuf Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds API links to the bottom of the page. Waiting on mui/material-ui#44992 to be released & upgraded on X docs before these will work.

@KenanYusuf KenanYusuf marked this pull request as ready for review January 15, 2025 12:24
@@ -0,0 +1,94 @@
# Data Grid - Components
Copy link
Member Author

@KenanYusuf KenanYusuf Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelsycamore keen to get your thoughts on the structure/contents of the new "Components" section. In summary:

  • We are introducing some new composable components to the Data Grid to help users to extend the data grid.
  • The composition and customization APIs are slightly different to what Data Grid and Material UI users are used to, which is why I have included this "Overview" page (maybe "Usage" would be a better name?) to explain some of the new concepts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for naming this page Usage since we already have Overview pages elsewhere that serve a different purpose.

Copy link
Contributor

@samuelsycamore samuelsycamore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's an incomplete review of the docs—great job overall @KenanYusuf! As I dug deeper I realized there was a lot of repeated copy in which my notes from one doc would also apply to the others, so I'll leave it to you incorporate it across the board and then I'll be happy to give this a full review.

Comment on lines 46 to 48
The default elements can be replaced using the `render` prop. See [Grid components—Customization](/x/react-data-grid/components/overview/#customization).

See the [Toolbar—Custom elements demo](/x/react-data-grid/components/toolbar/#custom-elements) for an example.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • passive –> active and imperative ("Use X to achieve Y result" is usually the preferred structure for this kind of sentence in our docs)
  • I don't love the back-to-back links but I think we can get away with it by combining them into one sentence
Suggested change
The default elements can be replaced using the `render` prop. See [Grid components—Customization](/x/react-data-grid/components/overview/#customization).
See the [Toolbar—Custom elements demo](/x/react-data-grid/components/toolbar/#custom-elements) for an example.
Use the `render` prop to replace default elements.
See [Grid components—Customization](/x/react-data-grid/components/overview/#customization) for more details, and [Toolbar—Custom elements demo](/x/react-data-grid/components/toolbar/#custom-elements) for an example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that we need to link to two different docs here makes me think that this section ought to be fleshed out more to avoid this. Maybe not necessary for this PR but worth circling back to later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that we need to link to two different docs here makes me think that this section ought to be fleshed out more to avoid this

Right, there will be a lot more to show here once the Column Panel component has been built. Right now, it feels a bit much to include a demo of customizing just the trigger, but that's open to debate.

<Export.Excel />
```

### Print
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the other components on this page

Suggested change
### Print
## Print

Comment on lines 46 to 50

## Recipes

Below are some ways the Export component can be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels unnecessary given that there's only one demo. I would cut it and just go straight from ## Excel to ### Toolbar export menu

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels unnecessary given that there's only one demo

Yeah, fair point. I was trying to create a structure that works across all of the component pages, some of which will have multiple recipes. Probably not necessary though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, if it's helpful on other pages then I'm all for it—I'd rather see consistency across similar pages, so the reader knows exactly what to expect as they move between them.

docs/data/data-grid/components/export/export.md Outdated Show resolved Hide resolved
docs/data/data-grid/components/export/export.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Improved Toolbar
6 participants