Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lazy-load-img-component

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-load-img-component

An simple image lazy load component based on react hooks and IntersectionObserver

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

lazy-load-img-component

An simple image lazy load component based on react hooks and IntersectionObserver;

Install

npm install lazy-load-img-component

Supports Props

// loading图片 可选
loadingImg?: string;
// 图片加载失败展示图片
errorImg?: string;
// 图片链接
src: string;
// 承载图片容器样式
style?: CSSProperties;
// img 标签上的所有属性 排除src
imgOptions?: Omit<ImgHTMLAttributes<HTMLImageElement>, 'src'>;
// IntersectionObserver支持的属性
options?: IntersectionObserver;

Basic Usage

<LazyLoadImg
    src='https://img.alicdn.com/bao/uploaded/i1/2207626746794/O1CN01gMwL08203hU9QmV93_!!0-item_pic.jpg'
    style={{ width: '80px', height: '80px' }}
    imgOptions={{
        alt: '图片',
    }}
/>,

Keywords

FAQs

Package last updated on 07 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc