public/ folder, Astro’s optimized <Image /> component, or plain <img> tags. There’s no image build configuration to set up.
Adding Images
From URL
Use any public image URL:<img> tag — no allowlist or domain configuration required.
Uploading Images
Upload images directly in Kleap and the AI will place them for you:public/ folder, accessible at /image-name.jpg.
Generate Images with AI
Kleap can generate images for you with AI — free, no credits used:Astro Image Component
For images you ship with your site, use Astro’s built-in<Image /> component from astro:assets. Put the source in src/assets/ and import it:
Benefits
- Automatic optimization - Converts to WebP/AVIF
- Lazy loading -
loading="lazy"by default - Correct sizing - Serves an appropriately sized image
- No layout shift - Requires width/height, which prevents CLS
Plain img tags
For images inpublic/ (including uploaded and AI-generated ones), a normal <img> works too — just add width, height, and loading="lazy":
Ask AI to Optimize
Image Best Practices
File Formats
| Format | Best For |
|---|---|
| WebP | Photos, general use |
| PNG | Logos, icons, transparency |
| SVG | Icons, illustrations |
| AVIF | Best compression (newer) |
File Sizes
Keep images optimized:- Hero images: < 200KB
- Content images: < 100KB
- Thumbnails: < 30KB
Dimensions
Provide images at appropriate sizes. For responsive images, tell the browser which size to load with thewidths and sizes props:
Responsive Images
Cover a Container
To fill a container while keeping aspect ratio, size the wrapper and useobject-cover:
Responsive Sizes
Tell the browser what size to load:External Images
For images hosted elsewhere (Unsplash, a CDN, your own server), just reference the URL with a plain<img>:
images.unsplash.comcdn.pixabay.comres.cloudinary.com
Uploaded & Generated Images
Most images on a Kleap site are static assets — files you upload in Kleap or generate with AI. These are hosted by Kleap in yourpublic/ folder, so you reference them like any local image:
Background Images
CSS Background
For decorative backgrounds:With Overlay
Icons
Lucide Icons
Kleap uses Lucide icons vialucide-react, rendered inside React islands:
SVG Icons
For custom icons:Alt Text Guidelines
Always provide descriptive alt text:When to Use Empty Alt
Decorative images that don’t convey information:Common Image Patterns
Hero with Image
Image Gallery
Avatar
Troubleshooting
Image not loading
Image not loading
- Check the file path is correct
- Verify the image exists in the public folder
- For external images, confirm the URL is public and reachable
Image looks blurry
Image looks blurry
- Provide a higher resolution source image
- Check width/height props match the aspect ratio
- Prefer Astro’s
<Image />so the right size is served
Layout shift when loading
Layout shift when loading
- Always specify width and height
- Use Astro’s
<Image />, which reserves space automatically - Wrap in a sized container for cover/fill layouts
Using Videos
Learn how to embed videos in your app

