Skip to content

Commit 97acc97

Browse files
committed
Merge branch 'release/v1.0.7'
2 parents a8464dd + 5563ba5 commit 97acc97

File tree

11 files changed

+1411
-597
lines changed

11 files changed

+1411
-597
lines changed

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
.babelrc
88
.eslintrc
99
npm-debug.log
10-
lib
1110
example
11+
scripts
12+
package.js
13+
.versions

README.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,51 @@
1-
# react-image-smooth-loading
2-
Images which just flick to appear aren't cool. Images which appear smoothly with a fade like Instagram are cool
1+
ReactImg
2+
========
3+
React component for making your site images appear in a fade in.
4+
See a [demo](http://astrocoders.com/react-image-smooth-loading/).
5+
6+
# Usage
7+
8+
```js
9+
import Img from 'react-image-smooth-loading';
10+
11+
// Define which placeholder to show while the image is loading
12+
// Can be any image file.
13+
// There's already a default one in base64, but you'd like to change ;)
14+
Img.globalPlaceholder = '/images/placeholder.png';
15+
16+
const Container = React.createClass({
17+
render(){
18+
<div className="image-grid">
19+
{this._getImageList.map(url => {
20+
return (
21+
<div className="image-card">
22+
<Img src={url}/>
23+
<p>My awesome image</p>
24+
</div>
25+
);
26+
})}
27+
</div>
28+
},
29+
30+
_getImageList(){
31+
return [
32+
...
33+
];
34+
}
35+
});
36+
```
37+
38+
Remember that Img is totally responsive, which means that it will fit accordingly
39+
to the space given to it by its container.
40+
41+
42+
## Options
43+
44+
```js
45+
const settings = {
46+
src: '...' // Image source,
47+
placeholder: '...' // Optional image placeholder, overrides globalPlaceholder,
48+
holderClasses: '...' // Img container class
49+
imgClasses: '...' // Classes for <img/> tags
50+
};
51+
```

0 commit comments

Comments
 (0)