Image
The Image component is a wrapper for the native HTML <img> tag, with built-in styling for loading states.
Props
Prop | Type | Default | Description |
|---|---|---|---|
src | string | required | The image source URL. |
alt | string | required | Alternative text for the image. |
class | string | '' | CSS classes to apply to the image. |
overrideDefaultStyling | boolean | false | If true, removes the base fluid-image class. |
...rest | HTMLImgAttributes | — | Standard HTML <img> attributes. |
Samples
Standard Image
Renders a standard image immediately without any artificial delay applied.
0
<Container class="h-48 w-full overflow-hidden rounded-lg">1
<Image2
src="https://picsum.photos/id/1018/500/300"3
alt="Nature scene"4
class="h-full w-full object-cover"5
/>6
</Container>Loading State Demo
This example has a manual 3-second delay to showcase the skeleton effect.
0
<!-- The src is populated after a delay to demonstrate 1
the built-in skeleton loading effect -->2
<Image3
src={delayedSrc}4
alt="Delayed Image"5
class="h-full w-full object-cover!"6
/>