Image
Shows an image with a loading effect and a placeholder while it loads, and a fallback when it fails, such as a product shot.
Parts
| Part | File | Does |
|---|---|---|
| Image | Image.vue | Shows an image with a loading state and a fallback if it fails to load. |
| ImageFallback | ImageFallback.vue | Shows a placeholder in place of an image that failed to load. |
Anatomy
<Image>
<ImageFallback />
</Image>Styling
All of Image’s styles live in image.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- @lucide/vue
- class-variance-authority
API reference
Shows an image with a loading state and a fallback if it fails to load. Renders a <span>.
Props 7
| Prop | Type | Default | |
|---|---|---|---|
| class | ClassValue | — | |
| |||
| src | string | — | |
| |||
| alt | string | — | |
| |||
| loadingEffect | LoadingEffect | 'skeleton' | |
| |||
| fallbackSrc | string | — | |
| |||
| placeholderSrc | string | — | |
| |||
| priority | boolean | false | |
| |||
Slots 1
| Slot | Slot props | |
|---|---|---|
| fallback | — | |
| ||