← All Components

LazyImage

Media

Intersection Observer-based lazy loading with fade-in effect.

Live Demo

Images load when they scroll into the viewport. Scroll down to see lazy loading in action.

Usage

<script>
  import { LazyImage } from "jatui"
</script>

<LazyImage />

Props

PropTypeDefaultDescription
srcstring-Image source URL
altstring-Alt text
aspectRatiostring | nullnullCSS aspect ratio
fit"cover" | "contain" | "fill""cover"Object fit
widthnumber | nullnullImage width
heightnumber | nullnullImage height