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
| Prop | Type | Description |
|---|---|---|
| onLoad | () => void | |
| slotProps | { img?: Omit<DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "alt" | "src"> | undefined; overlay?: DetailedHTMLProps<HTMLAttributes... | |
| alt | string | |
| src | string | |
| delayTime | number | Delay (ms) between the image loading and the fade-in starting. |
| effect | { duration?: number | undefined; disabled?: boolean | undefined; style?: "opacity" | "blur" | "black-and-white" | undefined; } | |
| visibleByDefault | boolean | |
| disablePlaceholder | boolean | |
| viewportOptions | UseInViewOptions | |
| ratio | AspectRatio | Partial<Record<Breakpoint, AspectRatio>> |