Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Electron.js Desktop App Development

Lesson 20 of 28 · javascript

Accessibility – Keyboard, ARIA & High‑Contrast

Duration: 8 mins

Accessibility – Keyboard, ARIA & High‑Contrast

  • Keyboard navigation – ensure every interactive element is focusable (tabindex, proper <button> tags).
  • Use ARIA landmarks (role="dialog", aria‑label) to describe custom components.
  • Test with NVDA (Windows) or VoiceOver (macOS) to hear how the app is read.
  • Electron respects the OS’s high‑contrast mode; style your UI with relative colors (currentColor, systemColor).
  • Example of an accessible custom button in a renderer:
<button id="saveBtn" aria-label="Save document">💾 Save</button>
  • In the main process you can query the OS’s accessibility settings:
const { systemPreferences } = require('electron');
const highContrast = systemPreferences.isHighContrastColorScheme();
Previous: Performance Profiling – Chrome DevTools & Electron‑PerformanceNext: Capstone Project – Cross‑Platform Note‑Taking App