reboottime / UI-UX-For-SPAs

Some UI/UX practices I accumulated on building SPAs or browsing products on internet
0 stars 0 forks source link

Accessibility #8

Open reboottime opened 3 weeks ago

reboottime commented 3 weeks ago

Accessibility focuses on making web applications and websites usable by people with various disabilities or impairments.


Accessibility topics include:

  1. Web Content Accessibility Guidelines (WCAG)
  2. Semantic HTML
  3. ARIA (Accessible Rich Internet Applications) attributes
  4. Keyboard Navigation
  5. Color contrast and visual design
  6. Screen reader compatibility
  7. Accessible forms and error handling
  8. Testing tools for accessibility


(Credit goes to claude.ai and critical thinking training)

reboottime commented 3 weeks ago

ARIA (Accessible Rich Internet Applications) attributes

The Purpose: ARIA roles define the type and functionality of an element, especially when HTML5 semantic elements aren't sufficient.

Basic Example

<div role="button" tabIndex="0">Click Me</div>

Common Roles

ARIA (Accessible Rich Internet Applications) attributes

reboottime commented 4 days ago

Keyboard Navigation

Keyboard navigation is a crucial aspect of web accessibility, allowing users who can't or prefer not to use a mouse to interact with web content.

Key aspects of keyboard navigation include:

  1. Focus management:

    • Ensure all interactive elements can receive keyboard focus
    • Provide a visible focus indicator
    • Maintain a logical tab order
      • tabIndex='0'
      • keydown.enter
      • focus-visible, focus-within
  2. Keyboard shortcuts:

    • Implement common shortcuts (e.g., Esc to close modals)
    • Document custom shortcuts for users
  3. Skip links:

    • Allow users to bypass repetitive content (e.g., navigation menus)
  4. Keyboard traps:

    • Avoid situations where keyboard users can't exit a component or page section
  5. Off-screen content:

    • Ensure hidden content isn't accidentally focusable
  6. ARIA for complex widgets:

    • Use appropriate ARIA roles and properties for custom interactive elements
  7. Testing:

    • Regularly test your site using only a keyboard to identify issues
reboottime commented 3 days ago

placeholder