Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 633 Bytes

README.md

File metadata and controls

22 lines (19 loc) · 633 Bytes

smart-image

An image element that automatically recovers a failed image on an unstable network using a custom element.

How to use

import

import 'smart-image'

attributes

  • src: image resource
  • fit: same as object-fit (Optional)
  • position: same as object-position (Optional)
  • lazy: start loading when the image is inside the viewport (Optional)
<smart-image fit="cover" position="center" src="https://avatars.githubusercontent.com/u/80738866?v=4"/>

Lazy Loading

<smart-image fit="cover" position="center" src="https://avatars.githubusercontent.com/u/80738866?v=4" lazy />