Skip to main content
Embed images with sizing, aspect ratio, and cropping.

Props

PropTypeDescription
srcstringFile path or URL
widthMeasurementValueImage width
heightMeasurementValueImage height
altstringAlt text
classNamestringTailwind classes
idstringUnique identifier

Loading images

Local files

Remote URLs


Supported formats

  • PNG
  • JPEG
  • GIF (static)
  • BMP
  • WebP

Sizing

Units

Width only

Height calculated from original aspect ratio:

Height only

Width calculated from original aspect ratio:

Both

Explicit dimensions (may stretch):

No dimensions

Uses original image size:

Aspect ratio

Control aspect ratio with Tailwind classes:

Object fit

Control how image fills the space:

Cover (crop to fill)

Crops image to fill dimensions. Maintains aspect ratio, removes overflow.

Contain (fit inside)

Scales to fit within dimensions. May have empty space.

Default (stretch)

Stretches to fill. May distort image.

Common patterns

Logo in header

Product image

Thumbnail grid (in table)

Screenshot with border


Limitations

  • Inline positioning only (no text wrapping)
  • No floating images
  • No rotation or transforms
  • No filters or effects
  • No SVG support
  • No animated GIFs (static frame only)