# Handle Image Loading Errors Gracefully

Replace broken images with fallbacks using the onerror attribute, provide meaningful placeholder content, and implement skeleton loaders to maintain user experience and visual consistency during image loading failures.

**Canonical URL:** https://skillshunter.net/skills/github-thedaviddias-front-end-checklist-skills-error-images-f74bd93a08c3

**JSON URL:** https://skillshunter.net/api/public/v1/skills/github-thedaviddias-front-end-checklist-skills-error-images-f74bd93a08c3

**Markdown URL:** https://skillshunter.net/skills/github-thedaviddias-front-end-checklist-skills-error-images-f74bd93a08c3.md

**Instructions download URL:** https://skillshunter.net/skills/github-thedaviddias-front-end-checklist-skills-error-images-f74bd93a08c3/download

**Category:** Software & Development

**Source URL:** https://github.com/thedaviddias/Front-End-Checklist/blob/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e/skills/error-images/SKILL.md

**Source commit:** e8d14d049010e2ce25afcd5e8609dfcbbe63e47e

**Listing approved at:** 2026-11-23

**Created at:** 2026-11-22T16:02:06.000000Z

**Updated at:** 2026-11-23T04:55:08.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Ensure the onerror attribute is correctly implemented with valid fallback image URLs. Prepare placeholder content that matches the context of the missing image. The first deliverable is a working fallback image or placeholder content that appears when the primary image fails to load.

### When to use it

- Replace broken images with fallbacks using onerror attribute
- Provide meaningful placeholder content instead of broken image icons
- Implement skeleton loaders for better user experience during image loading

## Skill instructions

---
name: error-images
description: "Use when reviewing image assets, markup, and CDN or build transforms related to Handle image loading errors gracefully. Check encoded size, rendered size, loading strategy, and above-the-fold impact together."
metadata:
  category: images
  priority: low
  difficulty: beginner
  estimatedTime: "15"
  source: frontendchecklist.io
  url: https://frontendchecklist.io/rules/images/error-images
---

# Handle image loading errors gracefully

Broken image icons look unprofessional and confuse users—graceful fallbacks maintain visual consistency and user trust when images fail to load.

## Quick Reference

- Use onerror to replace broken images with fallbacks
- Provide meaningful placeholder content, not broken image icons
- Consider skeleton loaders while images load
- Log image errors for monitoring and debugging

## Check

Check if the website handles broken images gracefully with fallback images or error states.

## Fix

Implement fallback images or placeholder content for broken image scenarios.

## Explain

Explain how proper error handling for images improves user experience.

## Code Review

Review image assets, markup, and delivery configuration related to Handle image loading errors gracefully. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.

---

For full implementation details, code examples, and framework-specific guidance,
see `references/rule.md`.

Rule page: https://frontendchecklist.io/rules/images/error-images

