Real-world UI patterns demonstrating icon integration with Bootstrap components and proper accessibility techniques.
Combine icons with buttons for visual clarity. Use spacing utilities
(.me-1, .ms-1) between icons and text.
Icon-only buttons must have aria-label for screen readers.
Icons use aria-hidden="true" to avoid redundant announcements.
Icons enhance navigation by providing visual cues. Keep icons decorative when text is present.
Use icons as visual markers in lists. Icons should be decorative when the list item text conveys meaning.
Social icon links require accessible names since they contain no visible text.
Use aria-label on the link element.
Position badges on icons for notifications and counts.
Include visually-hidden text for screen readers.
Proper accessibility ensures icons are announced correctly by screen readers. The approach depends on whether the icon conveys meaning or is decorative.
When icons convey meaning not available in text, provide accessible text.
visually-hidden text
aria-label on parent element
title + role="img" (shows tooltip)
Icons that don't add meaning should be hidden with aria-hidden="true".
When visible text describes the action, hide the icon from screen readers to avoid redundant announcements.