A custom Image component/tag like component with customizations, loader ...
If you're seeing this, you've probably already done this step. Congrats!
npm i lazy-svelte-image
Once you've installed you can import the package and use just like <img>
. an exaple is given below
import { Image } from 'lazy-svelte-image'
<Image src="" alt="" />
# or
<Image> <!-- slot--> </Image>
Currenlty you can provide custom loader and broken image icon as slot. use slot like how you use it in svelte.
disableLoader
- disable all loadersdisableBroken
- disable all broken viewbackgroundColor
- set custom background color for default broken/loader<span slot="broken">
<!-- provide code here -->
</span>
<span slot="loader">
<!-- provide loader code here -->
</span>