Skip to content
Vy logo
Guides

Web Accessibility Guide 🦾

Making the web accessible ensures that everyone, including people with disabilities, can use and interact with digital products. This guide provides best practices, tools, and key considerations for improving accessibility in your applications. πŸš€

πŸ“– Semantic HTML

Avoid wrapping elements in <div>s without meaning. This makes it difficult for assistive technologies like screen readers and search engines to interpret content correctly. Instead, use meaningful HTML elements:

βœ… Use <h1> to <h6> for headings
βœ… Use <p> for paragraphs
βœ… Use <button> for interactive buttons
βœ… Use <input type="radio"> for single-choice selections
βœ… Use <input type="checkbox"> for multiple-choice selections

⚠️ If using <div>s for styling, make sure to include the correct ARIA roles.

Why Semantic HTML Matters πŸ†

πŸ”Ž SEO: Helps search engines index your content correctly.
🎧 Screen Readers: Clearly communicates structure to visually impaired users.
πŸ“‘ RSS Readers: Ensures proper parsing and styling.

Best Practices for HTML Structure βœ…

πŸ”Ή Use only one <h1> per page for better SEO and accessibility.
πŸ”Ή Do not skip heading levels (h2 should not jump to h4).
πŸ”Ή Use proper HTML elements instead of <div>s and <span>s where possible.

🎭 Using ARIA for Accessibility

What is ARIA? πŸ€”

The Web Accessibility Initiative – Accessible Rich Internet Applications (ARIA) improves accessibility for complex UI elements when native HTML is not sufficient.

When to Use ARIA 🚨

❌ Not for everything – Use semantic HTML first whenever possible.
βœ… For complex UI components like modals, tooltips, and dynamic content.

Common ARIA Attributes πŸ”€

πŸ”Ή aria-expanded – Indicates if an element (e.g., accordion) is open (true) or closed (false).
πŸ”Ή aria-controls – Links elements together (e.g., button controlling an expandable section).
πŸ”Ή aria-labelledby – Associates an element with a visible label.
πŸ”Ή aria-hidden – Hides decorative elements from screen readers.
πŸ”Ή aria-live – Announces live content updates (e.g., errors, chat messages).

πŸ›‘ Common Accessibility Issues & Fixes πŸ”§

❌ Problem: A button labeled "Read more" provides no context.
βœ… Solution: Use clear, descriptive text or add an aria-label.

❌ Missing Context for Elements

❌ Problem: A departure time ("15:44") doesn’t explain its meaning.
βœ… Solution: Use aria-label: "Departure at 15:44. Arrival at 22:27. Travel time is 6 hours and 43 minutes."

πŸ“· Non-Informative Images & Icons

❌ Problem: Images/icons without alt text are meaningless for screen readers.
βœ… Solution: Use aria-hidden="true" for decorative elements.

⌨️ Keyboard Navigation

➑️ Tab: Move forward through interactive elements.
⬅️ Shift + Tab: Move backward.
⏎ Enter: Activate links.
πŸ”² Spacebar: Activate buttons and checkboxes.
πŸ”½ Arrow keys: Navigate dropdowns and radio buttons.

Best Practices 🎯

βœ… Ensure logical tab order – Follow the natural reading order.
βœ… Avoid unnecessary tab stops – Don’t make users tab through unimportant elements.
βœ… Avoid tabindex values greater than 0 – It disrupts the natural flow.
βœ… Avoid keyboard traps – Ensure users can always navigate forward and backward.

πŸ“± Accessibility for React Native

React Native Accessibility Checklist πŸ“‹

βœ… All interactive components should be accessible (accessible={true}).
βœ… Use accessibilityLabel for meaningful descriptions.
βœ… Use accessibilityRole to define component purpose (button, link, header).
βœ… Use accessibilityState to describe component states (e.g., selected, disabled).
βœ… Use accessibilityLiveRegion to notify users of dynamic changes.

🦻 Screen Reader Usage

πŸ“’ VoiceOver (Mac & iPhone)

πŸ”Ή Enable VoiceOver:

  • Mac: System Preferences β†’ Accessibility β†’ VoiceOver β†’ Enable.
  • iPhone: Settings β†’ Accessibility β†’ VoiceOver β†’ Enable.

πŸ”Ή Navigation:

  • Ctrl + Option + Arrow keys: Move through content.
  • Ctrl + Option + Space: Activate elements.
  • Ctrl + Option + Cmd + H: Jump between headings.

πŸ’» NVDA (Windows)

πŸ”Ή Enable NVDA: Ctrl + Alt + N πŸ”Ή Navigation:

  • H / Shift + H: Move through headings.
  • Up/Down arrows: Move line by line.
  • Caps Lock + Space: Enter/exit forms mode.

πŸ€– TalkBack (Android)

πŸ”Ή Enable TalkBack: Settings β†’ Accessibility β†’ TalkBack β†’ Enable.
πŸ”Ή Navigation:

  • Swipe left/right: Move through elements.
  • Double-tap: Activate elements.
  • Drag with two fingers: Scroll.

πŸ” Adjusting Text Size & Zooming 🧐

How to Check Zoom Accessibility πŸ”Ž

πŸ”Ή Test your site at 125%, 150%, and 200% zoom to ensure layouts remain usable.
πŸ”Ή Avoid fixed pixel (px) units for spacing and font sizes; prefer relative units (rem, em).
πŸ”Ή Borders (e.g., 1px solid) are fine but should be tested under high contrast settings.

System Settings to Adjust Text Size πŸ”§

  • Mac: System Preferences β†’ Accessibility β†’ Display β†’ Text Size.
  • Windows: Settings β†’ Ease of Access β†’ Display β†’ Make text bigger.
  • Android: Settings β†’ Accessibility β†’ Visibility Enhancements β†’ Font Size and Style.
  • iPhone: Settings β†’ Accessibility β†’ Display & Text Size β†’ Larger Text.

πŸ“š Further Reading

πŸ”— W3C Web Accessibility GuidelinesEkstern lenke
πŸ”— ARIA Patterns & Best PracticesEkstern lenke

By following these best practices, we can ensure that our web experiences are inclusive for all! 🌍✨