Material-ui-pickers: [suggestion] Consider using svg icons instead of font icons

Created on 14 May 2018  路  4Comments  路  Source: mui-org/material-ui-pickers

Why don't you use svg icons from @material-ui/icons?
It's easier to use and a lot of people consider svg as the winner in a svg-vs-font battle (https://css-tricks.com/icon-fonts-vs-svg/)
And you don't need to configure/enable another one loader for fonts in your webpack config (yes, you can the google's font, but it doesn't work for the most of cordova cases)

Most helpful comment

@amok it's up to you which solution you like more - you can use SVG icons instead of icons font by passing leftArrowIcon, rightArrowIcon, and keyboardIcon props to picker ;)

All 4 comments

@amok Actually because there is some people which do not use svg icons, and uses icon font instead. At least there were :)

@amok it's up to you which solution you like more - you can use SVG icons instead of icons font by passing leftArrowIcon, rightArrowIcon, and keyboardIcon props to picker ;)

The point is that if the lib uses fonts, developers who don't use fonts are forced to add them or pass this props @cherniavskii mentioned every time.
But if the lib uses @material-ui/icons it works out of the box for everyone
Anyways, thanks for the fast reply and the great lib)

... or pass this props ... every time

Well, that's not actually true - you can create your own component, which wraps picker component and passes custom props to it. Then you can use your wrapper component instead of mui-pickers one in your app. This way you can pass icons props only once per picker.

Anyway, each solution has it's pros and cons. And that's always a question which one should be used by default.
And, surprisingly, there's no proper answer for that question, since there'll always be a developer who prefers the opposite solution.

In this case our goal is to give a choice - so everyone is happy ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sakulstra picture sakulstra  路  3Comments

harvitronix picture harvitronix  路  3Comments

brett-patterson picture brett-patterson  路  3Comments

katy6514 picture katy6514  路  3Comments

danmce picture danmce  路  3Comments