mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.74k stars 32.24k forks source link

Add possibility of the `Select` component to render additional elements in dropdown #34516

Open shestakova1806 opened 2 years ago

shestakova1806 commented 2 years ago

Duplicates

Latest version

Summary 💡

It should be a possibility in dropdown of Select component to add some additional elements. It could be an additional fixed section in dropdown where developers can add necessary elements with their own functionality.

Examples 🌈

For example, we need to have controlled Select with 3 buttons in the dropdown to control the multiple selections.

Screenshot 2022-09-29 at 14 32 19

Motivation 🔦

For now there is no such possibility in the Select component and we have to implement the section with necessary buttons with hacky approach (the only one existing approach using MUI API): MenuItem component is used as container for menu items block and actions buttons block, but logically that implementation is incorrect.

michaldudak commented 2 years ago

The Unstyled Select component from MUI Base has the feature you're asking for. We are going to use it in Material UI Select's implementation in the future, so it'll be possible to use arbitrary elements in it as well. I can't, however, commit to a timeframe for this yet. I'll keep this issue open so we can track it.

shestakova1806 commented 2 years ago

@michaldudak Thanks for your answer. I hope we will be successful with implementation of our component with Unstyled Select.

michaldudak commented 2 years ago

If you encounter any problems or just have general feedback about the Unstyled Select, I'd be most grateful if you let me know.