@consumidor-positivo/ts-utils - v1.34.0
    Preparing search index...

    Function LazyImage

    • An <img> wrapper that defers loading until the image enters the viewport using IntersectionObserver.

      Parameters

      • __namedParameters: LazyImageProps

      Returns Element

      A lazily-loaded <img> element

      When lazy is true (default), the src is withheld until the element scrolls into view, reducing initial page load. Falls back to eager loading when lazy={false} or when IntersectionObserver is unavailable.

      import { LazyImage } from '@consumidor-positivo/ts-utils/react';

      <LazyImage src="/hero.jpg" alt="Hero image" width={800} height={400} />

      // Disable lazy loading for above-the-fold images
      <LazyImage src="/logo.png" alt="Logo" lazy={false} />