Adding Images
From URL
Use any public image URL:Uploading Images
Upload to your app’s public folder:public/ and are accessible at /image-name.jpg.
AI-Generated Placeholders
For development, use placeholder services:Next.js Image Component
Always use the Next.js Image component for optimization:Benefits
- Automatic optimization - WebP/AVIF conversion
- Lazy loading - Images load as needed
- Responsive - Serves correct size
- No layout shift - Prevents CLS
Ask AI to Convert
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:Responsive Images
Fill Mode
For flexible sizing:Responsive Sizes
Tell the browser what size to load:External Images
Configure Domains
For external images, add to config:Common Domains
Popular image services:images.unsplash.comcdn.pixabay.comres.cloudinary.com- Your Supabase storage URL
User-Uploaded Images
Supabase Storage
Store user uploads in Supabase:Display from Storage
Background Images
CSS Background
For decorative backgrounds:With Overlay
Icons
Lucide Icons
Kleap uses Lucide icons (via shadcn/ui):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 image exists in public folder
- For external images, check domain is configured
Image looks blurry
Image looks blurry
- Provide higher resolution source image
- Check width/height props match aspect ratio
- Use quality prop for higher quality
Layout shift when loading
Layout shift when loading
- Always specify width and height
- Use placeholder=“blur” for blur-up effect
- Use fill with sized container
Using Videos
Learn how to embed videos in your app

