All Projects β†’ yosbelms β†’ React Progressive Loader

yosbelms / React Progressive Loader

Utility to load images and React components progressively, and get code splitting for free

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Progressive Loader

jekyll-loading-lazy
πŸ§™πŸ½β€β™€οΈ Automatically adds loading="lazy" to <img> and <iframe> tags. Load images on your sites lazily without JavaScript.
Stars: ✭ 41 (-81.7%)
Mutual labels:  lazyload, lazy-loading
React Lazy Load Image Component
React Component to lazy load images and components using a HOC to track window scroll position.
Stars: ✭ 755 (+237.05%)
Mutual labels:  lazy-loading, lazyload
magento2-catalog-lazy-load
Improve the load time of your Magento 2 categories pages by loading your images on demand with our Lazy Load Extension
Stars: ✭ 56 (-75%)
Mutual labels:  lazyload, lazy-loading
rocket-lazy-load
Standalone LazyLoad plugin for WordPress (based on WP Rocket)
Stars: ✭ 25 (-88.84%)
Mutual labels:  lazyload, lazy-loading
Responsively Lazy
Lazy load responsive images
Stars: ✭ 1,080 (+382.14%)
Mutual labels:  lazy-loading, lazyload
loadeer
🦌 Tiny, performant, SEO-friendly lazy loading library
Stars: ✭ 30 (-86.61%)
Mutual labels:  lazyload, lazy-loading
Vanilla Lazyload
LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading.
Stars: ✭ 6,596 (+2844.64%)
Mutual labels:  lazy-loading, lazyload
Accessible Image Lazy Load
😴 gandul! accessible lazy loading images
Stars: ✭ 281 (+25.45%)
Mutual labels:  lazy-loading, lazyload
Jquery.lazy
A lightweight, fast, feature-rich, powerful and highly configurable delayed content, image and background lazy loading plugin for jQuery & Zepto.
Stars: ✭ 965 (+330.8%)
Mutual labels:  lazy-loading, lazyload
Lozad.js
πŸ”₯ Highly performant, light ~1kb and configurable lazy loader in pure JS with no dependencies for responsive images, iframes and more
Stars: ✭ 6,932 (+2994.64%)
Mutual labels:  lazy-loading, lazyload
lazy-load-images.js
Progressive & lazy loading images.
Stars: ✭ 17 (-92.41%)
Mutual labels:  lazyload, lazy-loading
Ng In Viewport
Allows us to check if an element is within the browsers visual viewport
Stars: ✭ 178 (-20.54%)
Mutual labels:  lazy-loading, lazyload
guide-to-async-components
πŸ“– Guide To JavaScript Async Components
Stars: ✭ 79 (-64.73%)
Mutual labels:  lazyload, lazy-loading
lazysimon
Minimal effort 350 byte JavaScript library to lazy load all <img> on your website
Stars: ✭ 18 (-91.96%)
Mutual labels:  lazyload, lazy-loading
Nuxt Lazysizes
Lazysizes module for Nuxt.js
Stars: ✭ 25 (-88.84%)
Mutual labels:  lazy-loading, lazyload
Yall.js
A fast, flexible, and small SEO-friendly lazy loader.
Stars: ✭ 1,163 (+419.2%)
Mutual labels:  lazy-loading, lazyload
React Lazy
Universal lazy loader components using IntersectionObserver for React
Stars: ✭ 118 (-47.32%)
Mutual labels:  lazy-loading, lazyload
Medium Style Confirm
medium.com style confirm dialog
Stars: ✭ 164 (-26.79%)
Mutual labels:  medium
Taro Listview
taroζ‘†ζžΆι•Ώεˆ—θ‘¨ζ–Ήζ‘ˆ οΌšι›†ζˆδΈ‹ζ‹‰εˆ·ζ–°γ€ιͺ¨ζžΆε±γ€ζ— ι™ζ»šεŠ¨γ€ε›Ύη‰‡ζ‡’εŠ θ½½οΌ›
Stars: ✭ 197 (-12.05%)
Mutual labels:  lazyload
React Intersection Observer
React implementation of the Intersection Observer API to tell you when an element enters or leaves the viewport.
Stars: ✭ 2,689 (+1100.45%)
Mutual labels:  lazy-loading

React Progressive Loader

Defer the load of non-critical images and components if they are off-screen.

This library makes possible to progressively load images, just like Medium does, and React components only when the user is ready to consume the content. Additionaly, take component based code splitting for free. Two at the price of one.

Lazy Loading Images: https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video/

Installation

// with yarn
yarn add react-progressive-loader

// with npm
npm install react-progressive-loader

Usage

// ES2015+ and TS
import { Defer, Img } from 'react-progressive-loader'

Components

Defer

Defers the loading of a React component

Props:

  • render: The content to render
  • renderPlaceholder: The content to render while the content is loading
  • loadOnScreen: Load the content only when the area it is going to be rendered is visible for the user

If case the React component is default-exported in ./comp module

<Defer
  render={() => import('./comp')}
  renderPlaceholder={() => <div>Loading...</div>}
/>

If the component is not default-exported

// './comp.jsx'
export const MyComp = () => 'Loaded!'

// './app.jsx'
<Defer
  render={() => import('./comp').then(({MyComp}) => <MyComp />)}
/>

The render prop can also be a React element

<Defer
  render={() => <img src='my-img.png'></img>}
  renderPlaceholder={() => <div>Loading...</div>}
/>

Load the content only when it is on-screen

<Defer
  render={() => <img src='my-img.png'></img>}
  renderPlaceholder={() => <div>Loading...</div>}
  loadOnScreen
/>

Img

Progressively load images. This component makes a smooth animated transition in the following order:

[Background]->[Placeholder]->[Content]

Props:

Any other prop (not listed here) passed to this components will be passed down to the wrapper div

Basic usage

<Img
  src='image.jpeg'
  placeholderSrc='image-placeholder.jpeg'
/>

Transitioning only between background and content. Sometimes you may want to transit only from background to content by finding the dominant color of the image and assigning it to bgColor. This strategy is used by Google image search.

<Img
  bgColor='#FA8054'
  src='image.jpeg'
/>

Load the content only when it is on-screen

<Img
  src='image.jpeg'
  placeholderSrc='image-placeholder.jpeg'
  loadOnScreen
/>

This library uses IntersectionObserver API, for wide browser compatibility consider to add a polyfill

Published under MIT Licence

(c) Yosbel Marin 2018

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].