1.0.6 • Published 5 years ago

@binance-academy/fallback-image v1.0.6

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Image with fallback

Display a fallback while an image is loading, to avoid a jump effect when the image loads.

example

Install

yarn add @binance-academy/fallback-image
npm install @binance-academy/fallback-image

Usage

Props

src: Url of the image

alt: Alternative text to displayed if the image connot be loaded

invertedRatio: Inverted ratio as a % (Default: 9/16*100=56.25)

Example

import Image from "fallback-image";

...

<Image alt="Alt text" src="https://via.placeholder.com/800x450" />

<Image
    alt="Alt text"
    src="https://via.placeholder.com/400x300"
    invertedRatio={(3 / 4) * 100}
/>
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago