material-ui-apollo-icons
v1.0.0-alpha.4
Published
Apollo Svg Icons converted to Material-UI React components.
Downloads
983
Readme
material-ui-apollo-icons
This package provides the Quintiles IMS Apollo Icons packaged as a set of React components.
Installation
Install the package in your project directory with:
yarn add material-ui-apollo-icons
These components use the Material-UI SvgIcon component to
render the SVG path for each icon, and so a have a peer-dependency on the next
release of Material-UI.
If you are not already using Material-UI in your project, you can add it with:
yarn add @material-ui/core
Usage
The import path for each Material icon component includes the icon name in PascalCase.
For example to use the 'account' icon component, import material-ui-apollo-icons/Account
.
Examples
- If your environment doesn't support tree-shaking, the recommended way to import the icons is the following:
import AccountIcon from 'material-ui-apollo-icons/Account';
import AirplaneIcon from 'material-ui-apollo-icons/Airplane';
- If your environment support tree-shaking you can also import the icons that way:
import { Account, Airplane } from 'material-ui-apollo-icons';
Note: Importing named exports in this way will result in the code for every icon being included in your project, so is not recommended unless you configure tree-shaking.