Skip to content

Image

Image with lazy loading, blur placeholder and aspect ratio.

Installation

bun add @xerobi/ui
import { Image } from "@xerobi/ui/image"

This component is client-side. In Astro, hydrate it with a client directive.

API reference

Image

PropTypeDescription
onLoad() => void
slotProps{ img?: Omit<DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "alt" | "src"> | undefined; overlay?: DetailedHTMLProps<HTMLAttributes...
altstring
srcstring
delayTimenumberDelay (ms) between the image loading and the fade-in starting.
effect{ duration?: number | undefined; disabled?: boolean | undefined; style?: "opacity" | "blur" | "black-and-white" | undefined; }
visibleByDefaultboolean
disablePlaceholderboolean
viewportOptionsUseInViewOptions
ratioAspectRatio | Partial<Record<Breakpoint, AspectRatio>>

Search documentation

Search pages, components and blocks.