figure-figcaption
Fungsinya
Skill ini memeriksa apakah keterangan gambar di halaman sudah ditandai dengan benar. Skill ini cocok untuk developer dan editor yang menerbitkan konten dengan gambar.
Kapan dipakai
- āSaat gambar di halaman Anda memiliki keterangan yang ditulis dalam paragraf biasa.
- āSaat Anda menerbitkan artikel dengan foto, grafik, atau diagram.
- āSaat keterangan gambar Anda perlu dibaca dengan benar oleh alat bantu.
Link skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/figure-figcaption/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
āBisakah Anda menata foto dan keterangan di artikel saya dengan struktur yang benar?ā
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menemukan gambar yang memiliki teks tepat di sebelahnya dan membungkus setiap pasangan dalam elemen figure dengan figcaption. Agent juga memeriksa bahwa teks alternatif tidak sama persis dengan keterangan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Use <figure> and <figcaption> for image captions
Using a <p> tag as a caption is invisible to assistive technology as an image description. The <figure>/<figcaption> pattern creates a machine-readable relationship between an image and its caption, which screen readers surface to users. It also communicates to search engines that the caption describes the image, supporting image SEO.
Quick Reference
- Wrap image + visible caption pairs in
<figure>with<figcaption>as a direct child <figcaption>must be the first or last child of<figure>- Do not duplicate alt text in figcaptionāalt is the fallback, figcaption is the visible description
<figure>is appropriate for images, code blocks, diagrams, and chartsānot every image
Check
Scan the codebase for images with adjacent visible text that acts as a caption (e.g., a <p> or <span> immediately below an <img> describing it). Verify: 1) Such image-caption pairs are wrapped in <figure>. 2) The caption text is inside a <figcaption> element. 3) <figcaption> is a direct child of <figure>. 4) The alt text on the <img> is not identical to the <figcaption> textāthey serve different purposes. Flag any <img> followed by descriptive text that is not structured as figure/figcaption.
Fix
For each image with an adjacent caption: 1) Wrap the <img> and its caption text in a <figure> element. 2) Move the caption text into a <figcaption> element inside <figure>. 3) Review the <img> alt attributeāif the figcaption already fully describes the image for sighted users, the alt can be shorter or empty (alt="") only if the figcaption alone is sufficient for screen readers too; otherwise keep a concise alt. 4) Position <figcaption> as the first or last child of <figure>. Show the corrected HTML.
Explain
Explain the semantic meaning of <figure> and <figcaption>. The <figure> element represents self-contained content (an image, code sample, diagram) that is referenced from the main content but could be moved without affecting the document flow. <figcaption> provides a caption or legend for the figure. Screen readers announce the figcaption in association with the figure, giving users context. Without this markup, sighted users see a caption but screen reader users hear only the alt text with no indication that a visible caption exists.
Code Review
Review image assets, markup, and delivery configuration related to Use <figure> and <figcaption> for image captions. 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/figure-figcaption
Pertanyaan umum
Apa itu figcaption?
Itu adalah elemen HTML untuk keterangan, yang diletakkan di dalam elemen figure bersama gambarnya.
Apakah teks alternatif harus sama dengan keterangan?
Tidak. Skill menyatakan teks alternatif adalah deskripsi cadangan dan keterangan adalah teks yang terlihat, sehingga keduanya sebaiknya berbeda.
Apakah setiap gambar perlu figure?
Tidak. Skill menyatakan figure cocok untuk konten seperti gambar, blok kode, diagram, dan grafik, bukan setiap gambar.
Detail
Deskripsi asli dari pembuat
Use when reviewing image assets, markup, and CDN or build transforms related to Use <figure> and <figcaption> for image captions. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
Popularitas
- Bintang GitHub
- 75k
- Peringkat
- #2843
- Lisensi
- MIT
- Diperbarui
- 31/10/2026
Komentar
- ā¦
Skill lain dari repositori ini
frontendchecklist
75kMemeriksa kode frontend dan halaman langsung terhadap lebih dari 380 aturan untuk aksesibilitas, kecepatan, SEO, dan keamanan, dengan alat baris perintah.
frontend-checklist-global
75kMengaudit proyek frontend terhadap seluruh 386 aturan Front-End Checklist, dan memberikan perbaikan spesifik untuk setiap masalah yang ditemukan.
404-page
75kMemeriksa bahwa halaman tidak ditemukan Anda menawarkan tautan yang membantu dan mengembalikan status 404 yang sebenarnya, untuk membantu pengunjung yang tersesat.
about-page
75kMeninjau apakah situs Anda memiliki halaman Tentang yang jelas yang menjelaskan siapa yang mengelolanya, untuk membangun kepercayaan pengunjung dan mesin pencari.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.