1.4.1 • Published 7 years ago

@logicline/material-ui-image v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Material UI Image

JavaScript Style Guide Build Status Greenkeeper badge

Images are ugly until they're loaded. Materialize it with material image! It will show a random material color as background and a loading animation until it's fully loaded.

See this component in action

This package is customized to use the scoped @logicline/material-ui package. Everything stayed the same.
The original package is available from npm via material-ui-image.

Installation

npm i --save @logicline/material-ui-image

Usage

Use this component just like a regular img tag.

import Image from '@logicline/material-ui-image'

// ...

render() {
  return (
    <div>
      <Image
        src="http://loremflickr.com/300/200"
      />
    </div>
  )
}

Material UI Image Properties

NameTypeDefaultDescription
src*stringSpecifies the URL of an image.
colorstringrandom colorOverride the background color.
disableErrorboolfalseDisables the error icon if set to true.
disableSpinnerboolfalseDisables the loading spinner if set to true.
errorSizeinteger48Set the size of the error icon.
imageStyleobject{ width: 'inherit', height: 'inherit' }Override the inline-styles of the image.
loadingSizeinteger40Set the size of the refresh indicator.
loadingStyleobject{ position: 'relative' }Override the inline-styles of the refresh indicator.
onTouchTapfuncFired when the user clicks on the image happened.
styleobject{ width: 300, height: 200 }Override the inline-styles of the root element.

* required property

License

The files included in this repository are licensed under the MIT license.