1.1.1 • Published 8 years ago

r-lazyload v1.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

react-lazyload

lazy load React Component

Usage

import 'Lazyload' from 'r-lazyload';

<Lazyload
  threshhold={0}
  cls="lazyload-placeholder"
/>
  <img src="image link" />
</Lazyload>

<Lazyload scrollerIsWindow={true}>
  <Your Component />
</Lazyload>

const Placeholder = () => (<div className="placehoder" />)
<Lazyload placeholder={<Placehoder />}>
  <Your Component />
</Lazyload>

Props

cls

type: String. Default: '' The class name for the default lazy-load dom(div), if you do not add a placeholder to the Lazyload.

scrollerIsWindow

type: Boolean. Default: false When it's value is true, it means that the window or ducument have scroll event. Otherwise, if the lazyload component is inside a overflow container, set false.

placeholder

type: element. Default: null The default Component for lazyload component when it's not visible.

threshold

type: number. Default: 0 The offset to scroller's viewport, and it should be a positive number. when component's distance to scroller's viewpoet less than threshold, it would preload.

LICENSE

MIT

1.1.1

8 years ago

1.0.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

1.0.0

8 years ago