
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-lazy-card
Advanced tools
A lighweight image lazy-loading component written in React
It supports both manual and automatic image lazy-loading.
Demo is available here.
npm install --save react-lazy-card
JSX:
import LazyCard from 'react-lazy-card';
<LazyCard image="b.jpg" autoLoad={true} defaultImage="default2.jpg">Text 2</LazyCard>
CSS
@import "react-lazy-card/dist/slide"
prop | default | description |
---|---|---|
className | string | custom classname for lazy-card component |
image | string | final image to be loaded |
defaultImage | string | pre-loader image to be shown |
autoLoad | false | should the component automatically lazyLoad the image |
attributes | {} | Additional attributes for component root |
title | '' | serves like alt attribute for img tag |
lazyLoad | true | enable/disable lazy load |
If autoload
is set to false the you have to manually call .load()
to load the image
// This will not load `image` automatically. Will load default1.jpg
const a = <LazyCard image="a.jpg" defaultImage="default1.jpg">Text 1</LazyCard>
a.load() // now image will be loaded
// Alternatively set `autoLoad` to true. So `a.jpg` will automatically replace
// default1.jpg when it is loaded.
<LazyCard image="a.jpg" defaultImage="default1.jpg" autoLoad={true}>Text 1</LazyCard>
git clone https://github.com/housinghq/react-lazy-card
cd react-lazy-card
npm install
npm run storybook
Open an issue before opening a PR. This package is optimised for mobile so its hard to include all the features.
###License MIT @ Loconsolutions
FAQs
A lighweight image lazy-loading component written in React
The npm package react-lazy-card receives a total of 39 weekly downloads. As such, react-lazy-card popularity was classified as not popular.
We found that react-lazy-card demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.