Image

The Image component is a wrapper for the native HTML <img> tag, with built-in styling for loading states.

Samples

Standard Image

Renders a standard image immediately without any artificial delay applied.

Nature scene

0

<Container class="h-48 w-full overflow-hidden rounded-lg">

1

  <Image

2

    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.

Delayed loading example

0

<!-- The src is populated after a delay to demonstrate 

1

     the built-in skeleton loading effect -->

2

<Image

3

  src={delayedSrc}

4

  alt="Delayed Image"

5

  class="h-full w-full object-cover!"

6

/>