Skip to main content

Starwind UI v3.0 beta is now available! Check out the new docs and try it out!

Image

Pricing illustration

Installation

Usage

General Notes

The Image component is a thin wrapper around Astro’s built-in <Image /> component. It provides:

  • Automatic size inference: inferSize is enabled by default, so you don’t need to specify width and height for remote images
  • Responsive defaults: Images are set to w-full h-auto for responsive behavior
  • Optimized output: Leverages Astro’s image optimization pipeline

Remote URL

You can use remote URLs directly. The component will automatically infer the image dimensions.

Sleek gray design

API Reference

Image

A wrapper around Astro’s Image component with sensible defaults and responsive styling.

PropTypeDefault
srcImageMetadata | string-
altstring""
inferSizebooleantrue
classstring-
<Image
src={imageSource}
alt="Description of image"
class="rounded-lg"
/>

Additional Notes:

  • src: Image source. Accepts imported image assets or remote URLs
  • alt: Alternative text for accessibility. Always provide meaningful alt text
  • inferSize: When true, automatically infers width and height for remote images. Disable if you want to specify dimensions manually

All other props from Astro’s <Image /> component are also supported (e.g., width, height, format, quality).

Changelog

v1.0.2

  • Refactor tailwind variants functions into separate variants.ts file

v1.0.0

  • Initial release with starwind v1.13.0