Generic Icon component instead of separate Icon components for each icon #44492
Labels
package: icons
Specific to @mui/icons
support: question
Community support but can be turned into an improvement
Summary
Material Icons provide separate icon components for each icon.
i.e. import { Abc } from '@mui/icons-material/Abc';
In some of cases, people require some kind of generic icon component where we just need to pass Icon Name and it will render that icon. i.e. Dynamic Icon Rendering.
There's some issue with dynamic import with next on Icon imports.
Better If we can have that Icon component with name property.
Examples
Current :
import { Abc } from '@mui/icons-material/Abc';
<Abc size={'small'} ... />
Expected :
import Icon from '@mui/icons-material'; // Or Whatever
<Icon name="Abc" size={'small'} ... />
Motivation
Most common use cases for this is, where icons are dynamic or coming from server side. Where we cannot map icons with each icon name.
Search keywords: Icon component
The text was updated successfully, but these errors were encountered: