Support replacing icons in various elements
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Summary š”
Some of the components in Material UI ship with built-in icons from the Material Design Icon set and only provide an option to replace them with other icons that donāt require a component as Font Awesome does.
Examples š
In case of Font Awesome, the following would be required to render the icon, but Material UI doesnāt allow this.
<Select
IconComponent={<FontAwesomeIcon icon={faChevronDown} />}
>
These are the places with the behavior Iād expect:
Breadcrumbs
āsseperator
propertyButton
āsstartIcon
andendIcon
propertyBottomNavigationAction
āsicon
propertyTab
āsicon
propertyAccordionSummary
āsexpandIcon
propertyChip
āsicon
anddeleteIcon
property
These components have icons that either can only be replaced with MUI icons or not at all:
StepLabel
Select
TablePagination
Iām sure I missed of others.
Motivation š¦
We use MUI, but are not looking to have Material Design as our design system. Weāre now stuck with using 2 iconsets; the iconset we use everywhere (being Font Awesome), and the iconset used by Material UI-components that donāt allow for icons to be replaced.
My appologies if Iām overlooking something here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Then Iāve got to say that Iām 100% lost and that this seems like a gap in MUIās documentation on how to do that. Because in regards to Font Awesome; how would I do this? The example given above doesnāt work for Selectās while it does work in the components listed in āthese do workā. This seems just inconsistent and could use some better documentation. Right now, MUI just shorts out with the following error:
Which, of course, is correct.
<FontAwesomeIcon />
isnāt a ReactElement but a node (which are allowed in the working examples given above) and that limitation currently doesnāt allow me to replace these icons with the iconset we use (this was perhaps poorly explained as the issue currently heavily implies that only MUI icons can be used).For anyone looking for a solution for using
<FontAwesomeIcon />
as step icon - this might get you started. With these style settings it doesnāt look as good as with the default material icons, though.