UX7: Accessible and inclusive design

Lesson 2 of 5 · reading 15–25 minutes; practice and project time is on the module page

Keyboard use and focus

🎯You'll be able to

Make every action work from a keyboard, with a visible focus indicator and a logical order.

🏠The everyday picture

Some people drive with hand controls instead of pedals. The car still has to go everywhere a normal car goes. A keyboard is a different set of controls for the same screens.

📘What it really is

📝A worked example

Input: the slot screen.

Steps:

  1. Open slot.html?clinic=gomti-nagar and press Tab repeatedly.
  2. In the starter, focus jumps from the Back link to "Continue": the times are divs and can't be reached.
  3. In the reference, each time is a <button aria-pressed="false">. Tab reaches 10:30; Space chooses it.

Expected output: test 3 of npm run test:prototype reaches 10:30 with Tab, presses Space, and checks aria-pressed="true", the words "Selected: 10:30" and that Continue is enabled. The focus outline is 3px solid var(--color-focus), which is 5.12 to 1 against the page background in the reference tokens; the starter's focus colour reaches only 1.43 to 1.

🌍Where it's used

📝Case scenario

A railway booking site's seat map could only be used with a mouse. A wheelchair user's organisation complained that its members could book a ticket but not choose an accessible seat. The seat map was rebuilt with buttons and a list alternative.

🖱️Try it

Book an appointment on the reference prototype using only the keyboard. Success: you complete the journey, you can see where focus is, and the order matches what you see.

⚠️Common mistakes

🛠️For your project

Project 2's test 3 checks the slot picker by keyboard, and Project 3's test 3 checks the focus colour's contrast.

✅Quick check

Which keys activate a button?

Show the answer

Enter and Space.

How much contrast does a focus indicator need?

Show the answer

At least 3 to 1 against what's next to it.

← PreviousWhy accessibility, and what WCAG asks
ProLearners Assist