Site settings
Change the appearance of the site to suit your preferences
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 π§
π« Poor Button & Link Descriptions
β 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
Navigating with the Keyboard πΉ
β‘οΈ 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! πβ¨