Sub topic 11
Making onboarding accessible
This chapter assumes you can build basic screens and forms, know what a modal and a tooltip are, and have seen the idea of a screen reader (software that reads the interface aloud). It uses WCAG, the Web Content Accessibility Guidelines, as the reference standard. Native mobile platforms have equivalent features: VoiceOver on iOS, TalkBack on Android, and dynamic text sizing.
Why onboarding needs extra care
Onboarding is the first thing every user meets, and it often blocks the rest of the app. A tour that traps a keyboard user, or a welcome screen a screen reader cannot read, stops that person before they reach any value. Onboarding also uses the patterns most likely to break accessibility: overlays, spotlights, carousels, animations, timed steps, and permission dialogs.
Accessible onboarding also helps users without disabilities. Examples are someone on a bright screen, someone with a broken wrist using only the keyboard, and someone who set a larger font size.
Core requirements for onboarding patterns
Each pattern fails in predictable ways. The table maps the common ones to fixes.
| Pattern | Typical failure | Fix |
|---|---|---|
| Modal welcome screen | Focus stays behind the modal; Escape does nothing | Move focus into the dialog, trap it there, close on Escape, return focus afterward |
| Step-by-step tour | Spotlight highlights an element, but a screen reader never reaches the tooltip | Place the tip next to its target in reading order, or link them with `aria-describedby` |
| Carousel of intro slides | Auto-advances; swipe is the only control | Provide Next and Back buttons, and no auto-advance, or a pause control |
| Checklist | Progress shown only by a green check icon | Add text such as "Completed" and expose it to assistive technology |
| Contextual hint | Disappears after a few seconds | Keep it until dismissed, or let the user extend the time |
| Permission priming | Explainer is an image of text | Use real text with a labelled Allow and Not now button |
Keyboard and focus
Everything must work without a pointer. Check these points:
- Every control can be reached with Tab and activated with Enter or Space.
- The focus order matches the visual order (WCAG 2.4.3).
- When a step appears, focus moves to it. Usually this means its heading, which gets
tabindex="-1"so it can receive programmatic focus. - When the flow closes, focus returns to the element that opened it, or to a sensible place in the main screen.
- The focus indicator is visible and not hidden by a sticky banner or the tour's own overlay (WCAG 2.4.11).
Names, roles, and announcements
A screen reader needs to know what each element is. Use real buttons (<button>), not clickable <div> elements. A dialog needs a role and a name, for example aria-labelledby pointing at its heading. A native <dialog> opened with showModal() gives you the role, the focus trap, and Escape handling for free, so prefer it over a custom overlay.
When the content changes without a page change, such as "Step 2 of 4", announce it. A role="status" region (polite live region) does this without stealing focus (WCAG 4.1.3). If you already move focus to the new step heading, the heading is read, so avoid announcing the same text twice.
Visual design
- Text contrast is at least 4.5:1, and icon or control-boundary contrast is at least 3:1 (WCAG 1.4.3 and 1.4.11). Check text placed over illustrations or gradients, which welcome screens often use.
- Do not use color alone. A skipped step and a completed step need different text or icons, not just different colors.
- Touch targets are at least 24 by 24 CSS pixels (WCAG 2.5.8), and 44 or larger is a better goal for primary buttons such as "Next".
- Layouts survive 200% text size and a 320 px wide viewport without clipping the Next button (WCAG 1.4.4 and 1.4.10). A fixed-height tour tooltip often fails here.
Motion and timing
Respect the user's reduced-motion setting. Animated mascots, parallax, and sliding transitions can cause discomfort for people with vestibular disorders. Auto-moving content that lasts over five seconds needs a way to pause or stop it (WCAG 2.2.2). Do not time out onboarding steps. If a step truly must expire, for example a one-time code, let the user extend it (WCAG 2.2.1).
A focus-managed tour step
The following TypeScript uses a native <dialog>. It assumes markup with a dialog element containing an h2 heading, a p with role="status", and a trigger button. It moves focus to the heading on each step, announces progress, returns focus on close, and turns off animation when the user asks.
interface TourStep {
title: string;
}
const tourSteps: TourStep[] = [
{ title: "Welcome" },
{ title: "Create your first project" },
{ title: "Invite a teammate" },
];
function setupTour(
dialog: HTMLDialogElement,
heading: HTMLElement,
status: HTMLElement,
trigger: HTMLElement
): { next: () => void; open: () => void } {
let index = 0;
const reduceMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
// Only animate for users who have not asked for reduced motion.
dialog.style.transition = reduceMotion ? "none" : "opacity 200ms ease";
function render(): void {
heading.textContent = tourSteps[index].title;
status.textContent = `Step ${index + 1} of ${tourSteps.length}`;
heading.tabIndex = -1; // lets the heading take focus, but keeps it out of the Tab order
heading.focus();
}
function open(): void {
index = 0;
// The browser closes a modal dialog on Escape and fires "close".
dialog.addEventListener("close", () => trigger.focus(), { once: true });
dialog.showModal(); // traps focus and makes the rest of the page inert
render();
}
function next(): void {
if (index < tourSteps.length - 1) {
index += 1;
render();
} else {
dialog.close();
}
}
return { next, open };
}The close listener means that Escape, the final step, and any "Skip" button all return focus the same way.
Accessible sign-up and permissions
Sign-up forms are part of onboarding, and WCAG 2.2 has rules aimed at them:
- Accessible authentication (3.3.8): Do not require a cognitive test, such as remembering a password or solving a puzzle, without an alternative. Allow paste into password fields, allow password managers to fill in credentials, and offer options like passkeys or email links.
- Redundant entry (3.3.7): Do not ask users to retype information they already gave in the same flow, such as an email address on a confirmation step.
- Labels and errors: Each input has a visible, programmatically associated label. Error messages say what went wrong and how to fix it, and they are linked to the field with
aria-describedby. Placeholder text is not a label.
For permission priming, your explainer is plain, readable text, and the choices are real buttons. "Not now" must be as easy to reach as "Allow". The system prompt that follows is controlled by the operating system and is already accessible. Your job is to make sure the screen before it is.
Skipping and resuming
Users of assistive technology often take longer on a first run, or leave and come back. Make "Skip" a normal, visible button, not a small gray link with low contrast. Keep progress saved so the flow can resume, as the progress model in the earlier chapter does. Offer a way to replay the tour from settings or help, since a screen reader user may want to hear it again once they know the app.
Common mistakes
- Using a third-party tour library and assuming it is accessible. Test it with a keyboard and a screen reader first. Many tooltip tours render outside the reading order or never move focus.
- Dimming the page with an overlay but leaving the background reachable with Tab, so focus disappears behind it.
- Putting key instructions only in a video with no captions or transcript, or only in an animation.
- Using "click the green button" or "swipe left" as instructions. Name the control by its label, and give a non-gesture alternative to any swipe.
- Announcing every change in a live region until the screen reader chatters. Announce only what the user needs.
Testing checklist
Run these in order for each onboarding build:
- Complete the entire flow with only the keyboard, or with a switch device or external keyboard on mobile.
- Complete it with a screen reader (VoiceOver, TalkBack, NVDA, or similar) with the screen off or the monitor not in view.
- Set the text size to 200% and zoom to the largest setting. Check that nothing is cut off.
- Turn on reduced motion and high contrast. Check that nothing important disappears.
- Run an automated checker such as axe. It catches missing labels and low contrast but not focus order or confusing flows, so it does not replace steps 1 to 4.
Exercise
A tour tooltip appears next to a button and fades in. A keyboard user presses Tab and lands on a field behind the dimmed overlay, and a screen reader says nothing when the tooltip appears. Name three changes that fix this.
Show answer
(1) Put the tour in a modal dialog, or otherwise make the background inert, so Tab cannot reach the page behind the overlay. (2) Move focus to the tooltip's heading when it appears, or announce it through a polite live region, so the screen reader reads it. (3) Close on Escape, return focus to the element that opened the tour, and honor prefers-reduced-motion for the fade.
Exercise
Your checklist shows completed items with a green check icon and skipped items with a gray dash icon. Why is this inaccessible, and what is a minimal fix?
Show answer
The state is conveyed only by icon and color, so screen reader users get no information and some sighted users cannot tell the colors apart. Add text such as "Completed" or "Skipped" for each item, either visible or as accessible text, and keep the icon contrast at 3:1 or higher.