# material-ui-mix-icon

> component for material-ui

Latest version **0.2.6** (published 2020-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install material-ui-mix-icon
pnpm add material-ui-mix-icon
yarn add material-ui-mix-icon
bun add material-ui-mix-icon
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2020-04-13 |
| First published | 2020-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 2 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Dev Eloper |
| Maintainers | kadarka |
| Keywords | reactjs, react, icon, icons, material-ui |

## Links

- npm: https://www.npmjs.com/package/material-ui-mix-icon
- Repository: https://github.com/rand0mC0d3r/material-ui-mix-icon
- Homepage: https://github.com/rand0mC0d3r/material-ui-mix-icon/blob/master/README.md
- Issues: https://github.com/rand0mC0d3r/material-ui-mix-icon/issues
- npm.io page: https://npm.io/package/material-ui-mix-icon

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.13.1
- [@material-ui/icons](https://npm.io/package/@material-ui/icons.md) ^4.9.1

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 0.2.6 (latest) — 2020-04-13
- 0.2.4 — 2020-04-13
- 0.2.3 — 2020-04-13
- 0.2.2 — 2020-04-13
- 0.2.1 — 2020-04-13
- 0.2.0 — 2020-04-13
- 0.1.0 — 2020-04-12

## README

# material-ui-mix-icon - ```<CombineIcon>```

![npm](https://img.shields.io/npm/v/material-ui-mix-icon) ![npm bundle size](https://img.shields.io/bundlephobia/min/material-ui-mix-icon) ![NPM](https://img.shields.io/npm/l/material-ui-mix-icon)

Combine **2 icons** for extra status display, exception notation or variance presentation.

![](https://raw.githubusercontent.com/rand0mC0d3r/material-ui-mix-icon/master/assets/examples.png)


**WHY**: When having a simple icon to describe one element, sometimes,
the element being flavored in specific ways needs a consistent way to
describe complex states; e.g:
- User vs User with Admin Privileges
- Server vs Server provisioned with K8s
- Email vs Email with Priority
- ...

---

#### Installation & Usage

```
npm install --save material-ui-mix-icon
```

##### Class React Component

```
import React, { Component } from 'react';
...
import ComposedIcon from 'material-ui-mix-icon';

class ExampleComponent extends Component {
    render() {
        return (
            <React.Fragment>
            ...
                <ComposedIcon
                    position="bottom-end"
                    size="medium"
                    icon='keyboard'
                    extraIcon='key'/>
            ...
            </React.Fragment>
        );
    }
}
export default ExampleComponent;
```

##### Functional React Component

```
import React from 'react';
...
import ComposedIcon from 'material-ui-mix-icon';

const ExampleComponent = ({..., position, ...}) => (
    <React.Fragment>
        ...
            <ComposedIcon
                position={position}
                size="medium"
                icon='keyboard'
                extraIcon='key'/>
        ...
    </React.Fragment>
)
...
export default ExampleComponent;
```

### Integration

##### The simple-embedded way (CDN reliant)
*NOTE:* Example based on the default project structure provided by facebook/create-react-app project

In ```public/index.html``` in the ```<head>``` section add:

```
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css" />
```

eventually should look like this:
```
<meta
    name="description"
    content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
...
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css" /> --- add this line
...
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
```

---

#### Configuration

Variables supported by the library and available knobs for customization. All enforced by PropTypes.

##### Required Properties

- *icon* - Supporting a string or a non `fa` object type
- *extraIcon* - Supporting a string or a non `fa` object type

##### Optional Properties

![](https://raw.githubusercontent.com/rand0mC0d3r/material-ui-mix-icon/master/assets/positions.png)

- *size* - selection from Material UI standard values: small, medium or large. Default: **small**
- *color* - inherited property from Material UI. Possible values: inherit, primary, secondary. Default: **inherit**
- *position* - Placement of extra icon. Possible values: top-start, top-end, bottom-start, bottom-end. Default: **bottom-end**
- *disabled* - Boolean to mark the disabled flag for the icon presentation. Default: **false**

---


#### Sample Usage

![](https://raw.githubusercontent.com/rand0mC0d3r/material-ui-mix-icon/master/assets/preview.png)

Simple usage in Material UI elements, as child element or startIcon or start/endAdornment:

Self contained component with example values:

```
<ComposedIcon
    position='bottom-end'
    color="primary"
    size="large"
    icon='server'
    extraIcon='dharmachakra'
/>
```

Embedded in a button

```
 <Button
    variant="contained"
    color="primary"
    size="small"
    startIcon={
        <ComposedIcon
            position={props.position}
            color="primary"
            size='small'
            icon='server'
            extraIcon='dharmachakra'
        />}
    >
    Sample
</Button>
```

Icon button usage:

```
<IconButton aria-label="sample-icon-button">
    <ComposedIcon
        position={props.position}
        size="large"
        icon='server'
        extraIcon='dharmachakra'
    />
</IconButton>
```

Fab button usage:

```
 <Fab disabled aria-label="like">
    <ComposedIcon
        position={props.position}
        size="large"
        disabled
        icon='server'
        extraIcon='dharmachakra'
    />
</Fab>
```

And also in a field with adornment

```
 <TextField
    id="input-with-icon-textfield"
    label="TextField"
    disabled
    defaultValue="disabled field"
    InputProps={{
    startAdornment: (
        <InputAdornment position="start">
        <ComposedIcon
            position={props.position}
            size="small"
            icon='server'
            extraIcon='dharmachakra'/>
        </InputAdornment>
    ),
    }}
/>
```

---
_Source: https://npm.io/package/material-ui-mix-icon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
