Image
An image element with a fallback.
Preview
Installation
npx sigma-ui@latest add imageUsage
vue
<script setup lang="ts">
import { Image } from '@/components/ui/image';
</script>
<template>
<Image
src="/photo.jpg"
alt="A mountain lake"
/>
</template>altis the accessible name. It defaults toimage, so set a real description for meaningful photos.glowadds a soft glow behind the image.shapeisroundedorcircle.- The
fallbackslot replaces the default placeholder when the image fails to load.
Examples
Basic
Glow
Custom fallback
API Reference
Image
Props
| Prop | Type | Default |
|---|---|---|
srcImage URL; the fallback is shown when it is empty or fails to load. | string | - |
altAlternative text for the image. | string | "image" |
glowRenders a blurred, saturated copy of the image behind it as a glow effect. | boolean | - |
shapeCorner style of the image. | "circle" | "rounded" | null | "rounded" |
Events
| Event | Payload |
|---|---|
errorEmitted when the image fails to load. | [] |
loadEmitted when the image finishes loading. | [] |
Slots
| Slot | Scope |
|---|---|
fallbackReplaces the default "no photo" placeholder shown when the image is missing or fails to load. | - |
Accessibility
The image is announced with its alt text. Leave alt empty only when the image is decorative, and give meaningful images a description. The fallback is shown when the file fails to load.
| Key | Description |
|---|---|
| Tab | Moves focus past the image. The image itself is not interactive. |
Sponsors
Support this project