Courses / React 19: From Components to Production / Chapter 20
Module 10 · Accessibility, Security and Delivery · Chapter 20 of 30
Accessibility, Internationalisation and Design Systems
Builds on Components: Props, Children, Conditions, Lists and Keys, Forms: Controlled and Uncontrolled Inputs, Validation and Form Actions, Advanced Hooks: Refs, Reducers, Context, Layout Effects and Custom Hooks and Testing React: Components, Hooks, Network and End-to-End. Next up: Security, Performance Budgets and Delivery.
Part 1 · Semantic HTML first: native elements, landmarks and labels
What assistive technology reads
A government scholarship page is used by students on phones, by parents on shared computers and by people who navigate with a keyboard or a screen reader. All of them depend on what the page says in its markup, and not only on how it looks.
A browser turns the DOM into an accessibility tree, a second tree that lists each element's role, its name and its state. Screen readers, voice control and keyboard navigation work from that tree. A button element gets the role button, the name from its text, and keyboard behaviour for free: it takes focus with Tab and activates with Enter and Space. A div with a click handler gets none of that. It looks the same on screen, and it is a generic box in the tree.
Semantic HTML means picking the element that matches the meaning: button for actions, a for navigation, h1 to h6 for headings in order, label for a field's name, and landmark elements such as header, nav and main for the regions of a page. This lesson compares two versions of the same page.