material-icons icon indicating copy to clipboard operation
material-icons copied to clipboard

How to use Material Icon in react native with expo?

Open KeflemTrindade opened this issue 2 years ago • 1 comments

I would like to use the icons listed here https://fonts.google.com/icons?icon.set=Material+Icons, no expo react native.

KeflemTrindade avatar Apr 26 '23 21:04 KeflemTrindade

I haven't used react-native or expo but it looks like it is possible to import SVGs directly using react-native-svg-transformer library. See expo docs.

Once you install and configure react-native-svg-transformer library you will be able to import Material Icons SVGs which are available in the @material-design-icons/svg package. You can import and use them as:

import Face from '@material-design-icons/svg/filled/face.svg';

<Face />;

There is an example for React in the README but the usage should be similar for React Native. Please let me know if it works.

marella avatar May 01 '23 15:05 marella