# img-material-ui

> A material-ui component which display an image from different sources based on the page's current width (based on material-ui defined breakpoints).

Latest version **1.1.0** (published 2019-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install img-material-ui
pnpm add img-material-ui
yarn add img-material-ui
bun add img-material-ui
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-04-04 |
| First published | 2019-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Iulian Radu |
| Maintainers | iulian-radu-at |
| Keywords | img, material-ui, img-material-ui, react, react-component, ui, material design |

## Links

- npm: https://www.npmjs.com/package/img-material-ui
- Repository: https://github.com/iulian-radu-at/img-material-ui
- Homepage: https://github.com/iulian-radu-at/img-material-ui#readme
- Issues: https://github.com/iulian-radu-at/img-material-ui/issues
- npm.io page: https://npm.io/package/img-material-ui

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^16.8.6
- [react-dom](https://npm.io/package/react-dom.md) ^16.8.6
- [@material-ui/core](https://npm.io/package/@material-ui/core.md) ^3.9.3
- [@material-ui/icons](https://npm.io/package/@material-ui/icons.md) ^3.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-04-04
- 1.0.0 — 2019-03-09

## README

# img-material-ui

A material-ui component which displays an image from different sources based on the page's current width (based on material-ui defined breakpoints).

The order of breakpoints: xs, sm, md, lg, xl. You can find [here](https://material-ui.com/layout/breakpoints) the values defined currently by material-ui for these breakpoints. 

---

## Props

The component accepts the props defined bellow in the table.

### Props accepted by ImgMaterialUi

| Name  | Type          | Required | Default   | Description                                                                         |
|-------|---------------|----------|-----------|-------------------------------------------------------------------------------------|
| id    | string        | no       | undefined | The id of the field                                                                 |
| lg    | string        | no*      | undefined | Source used for the lg breakpoint and wider screens (if not overridden)             |
| md    | string        | no*      | undefined | Source used for the md breakpoint and wider screens (if not overridden)             |
| sm    | string        | no*      | undefined | Source used for the sm breakpoint and wider screens (if not overridden)             |
| xl    | string        | no*      | undefined | Source used for the xl breakpoint and wider screens (if not overridden)             |
| xs    | string        | no*      | undefined | Source used for the xs breakpoint and bellow, and wider screens (if not overridden) |
| style | CSSProperties | no       | undefined | The style applied to the field                                                      |

no* means that at least one of them should be defined or an exception is triggered.
---

## Versions

| ImgMaterialUi _uses_ | Material-ui | React  |
|----------------------|-------------|--------|
| -------------------: | :---------: | :----: |
| 1.0.x                | 3.9.2       | 16.8.4 |
| 1.1.x                | 3.9.3       | 16.8.6 |

### About versioning schema used for ImgMaterialUi

- Major - it will be increased if the major version of the dependat package changes or there are breaking changes in the code of ImgMaterialUi
- Minor - it will be increased if no major version of the dependat package changes, but there are changes of the minor or patch versions of it
- Patch - it will be increased if there are no changes of the dependat packages, but there are non breaking changes in the code of ImgMaterialUi

---

## Example

Displaying an image in three sizes based on the current window size:

```js
import * as React from "react";
import ImgMaterialUi from "img-material-ui";

class App extends React.Component {
  render() {
    return (
      <div className="App">
        <ImgMaterialUi
          xs="/img/logo-small.jpg"
          md="/img/logo-medium.jpg"
          lg="/img/logo-large.jpg"
        />
      </div>
    );
  }
}

export default App;
```

---

## Changelog

### 1.0.0

- img-material-ui is made publicly available

### 1.1.0

- Updated packages

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