Accessible components: six base cards

A button, form with error guidance, dialog, tabs, disclosure and notification are shown separately.

Status: an author catalog and a training stand. This is neither a test result for a specific product nor an independent acceptance of the examples. The examples of the WAI-ARIA Authoring Practices Guide (APG) show implementation models, but on their own they do not confirm WCAG conformance or compatibility with every combination of browsers and assistive technologies.

How to read the cards

Each card describes one component as a sequence of observable states. A test must answer four questions:

  1. What was the state before the action?
  2. What action did the person perform?
  3. What changed visually, programmatically, and in the position of the focus?
  4. What did automation, manual testing, and a real assistive technology confirm?

For each run, record the component, state, and task, the product version, browser, operating system, and assistive technology, the settings, the steps, the expected and the observed result, the date, the person performing the test, and the evidence. The exact wording produced by a screen reader is not set as a universal reference: what is tested is the conveyed meaning and the possibility of performing the action.

Working basis: Methodology for Developing Accessible Sites and WCAG 2.2 Level A and AA Test Protocols. Common normative basis: WCAG 2.2, success criterion 2.1.1 "Keyboard", 2.4.3 "Focus Order", 2.4.7 "Focus Visible", 2.5.3 "Label in Name", 2.5.8 "Target Size (Minimum)", and 4.1.2 "Name, Role, Value".

C-01. Button

Open the working C-01 example.

Purpose and boundary. A button performs an action: it submits a form, opens a dialog, changes a setting, or starts an operation. Navigation to another address is usually a link. Source model: Button Pattern in W3C APG.

States and actions. Minimum set: available, focused, activated, unavailable. A toggle adds pressed and not pressed; a long-running action may need waiting, success, and error. The state before the action and the state after it are recorded separately.

Keyboard. The button receives focus in a logical order and is activated with Enter and Space. After the action, the focus stays on the button or moves to a new place that matches the result: inside the opened dialog, to the beginning of a new step, or to the logical continuation after an object has been deleted.

Designer:

  • distinguishes an action from link navigation;
  • sets a permanent visible label, a visible focus, unavailable, waiting, and result states;
  • shows the size of the whole activation area, not only of the icon;
  • describes the expected focus location after each action.

Developer:

  • prefers the native <button> and sets a correct type;
  • includes the text of the visible label in the accessible name; semantic similarity alone is not enough under WCAG 2.2, success criterion 2.5.3 "Label in Name";
  • updates the programmatic state of a toggle together with the visual one;
  • blocks unintended repeated submission without hiding the reason for the wait.

Reviewer:

  • finds the button with the keyboard, sees the focus, and activates it with both standard keys;
  • checks the name, role, state, and result before and after the action;
  • checks mouse, touch, and voice control by the visible label, if they are within the scope of the test;
  • repeats the action in error, waiting, and unavailable states.

Expectation in manual testing with a screen reader. The person gets a clear name and role for the button. For a toggle, the current state is available and after activation it changes consistently. The result of the action is discoverable without searching the whole page.

Boundary of automation. It is possible to detect part of the errors in name, role, focusability, target size, and ARIA values. Automation does not confirm that the action matches the label, that the new focus location is logical, that the message is understandable, or that the actual announcement of the assistive technology was not lost.

C-02. Form with validation

Open the working C-02 example.

Purpose and boundary. The card covers fields, groups, instructions, validation, submission, error, and successful completion as one route. Implementation basis: W3C WAI Forms Tutorial and the section User Notification.

States and actions. Empty form, input, invalid value, submission with an error, correction, repeated submission, waiting, success, or service error. A multi-step form adds the current step, the total number of steps, going back, and data retention.

Keyboard. Fields and actions are reached in the order of the task. Native elements keep their familiar keyboard model. After an error, the focus is moved to an agreed location, for example to the summary or to the first invalid field, and the further route stays understandable.

Designer:

  • keeps the label visible and stable after input;
  • places the format, requiredness, and constraints before they are needed;
  • groups related fields and distinguishes a hint, an error, and an overall summary;
  • designs the correction without losing the other entered data.

Developer:

  • links the label, field, instruction, and error programmatically;
  • uses suitable types, autocomplete, and native groups where they apply;
  • does not mark an error with colour only and updates the programmatic state after the correction;
  • does not create a repeating announcement for every typed character without necessity.

Reviewer:

  • inventories all visible and non-visual instructions, formats, and conditions;
  • walks the correct scenario and a predefined negative scenario;
  • triggers an error, finds it, moves to the field, corrects the value, and submits again;
  • checks the retention of the other data, time warnings, and the outcome of the operation.

Expectation in manual testing with a screen reader. On focus, the field name, type, requiredness, and the needed instruction are understandable. The error names the field and the reason, offers a way to correct it, and remains available until it is corrected. After the correction, the outdated error is no longer announced as current. The error requirements are specified in 3.3.1 "Error Identification" and 3.3.2 "Labels or Instructions".

Boundary of automation. It is possible to check the presence of part of the labels, groups, requiredness, programmatic relationships, and some messages. Manual actions are needed to confirm the clarity of the format, the timeliness of the error, the correction route, the retention of data, and the actual announcement in the selected configuration.

C-03. Modal dialog

Open the working C-03 example.

Purpose and boundary. A modal dialog temporarily restricts interaction to its own content. A window can be called modal only when the background is genuinely unavailable to all users. Source model: Dialog (Modal) Pattern in W3C APG.

States and actions. Closed, open with an initial focus, interaction inside, an error or a wait inside, closed with the focus returned. For an irreversible action, a safe initial focus position is designed separately.

Keyboard. On opening, the focus moves inside. Tab and Shift+Tab cycle through the elements of the dialog and do not reach the background. Escape closes the dialog according to the APG model; the interface also has a visible close action. After closing, the focus usually returns to the initiator, and if the initiator has disappeared, it moves to the logical continuation of the task.

Designer:

  • sets a visible heading, a close action, the initial focus, and the tabbing order;
  • shows modality visually and does not place a required action only outside the window;
  • chooses the initial focus by content: the beginning of complex text, a safe action, or the most likely continuation;
  • describes the focus return after each way of closing.

Developer:

  • uses the native <dialog> or fully implements the name, role, modality, and focus management;
  • makes the background inert for pointer and keyboard, and not only hidden from the accessibility tree;
  • does not place the dialog itself into a container hidden from assistive technologies;
  • returns the focus after Escape, the close button, cancellation, and successful completion.

Reviewer:

  • opens the window with the keyboard and checks the exact place of the initial focus;
  • walks forward and backward, trying to move to the background;
  • closes it by every provided way and checks the new focus location;
  • checks long content, zoom, an error, and a nested dialog, if it is supported.

Expectation in manual testing with a screen reader. The name and role of the window are available, the initial context does not turn into an unreadable long string, and background elements do not enter the working route. After closing, the person understands where to continue the task.

Boundary of automation. It is possible to check part of the roles, name, aria-modal, visibility, focusability, and programmatic relationships. Only a scenario confirms the trapping and return of the focus, the inertness of the background, the correctness of the initial location, and the actual behaviour of the screen reader.

C-04. Tabs

Open the working C-04 example.

Purpose and boundary. Tabs show one of several related panels. This is a composite widget with a single entry point in the sequential order and internal arrow navigation. Source model: Tabs Pattern in W3C APG.

States and actions. One tab is selected, the others are not; the focus may be on the selected tab or on another tab. Manual or automatic activation must be chosen in advance and must not be mixed unpredictably.

Keyboard. Tab moves the focus to the selected tab, and the next Tab leaves the list to the panel or to the next logical element. Left Arrow and Right Arrow move the focus along the horizontal list; in a vertical one, Up Arrow and Down Arrow are used. With manual activation, Enter or Space selects the tab. Home and End are additional commands. Automatic activation is suitable only when there is no noticeable delay.

Designer:

  • distinguishes focus from selection and makes both states noticeable;
  • sets the orientation, order, labels, and behaviour with long titles;
  • chooses the activation model taking into account the delay of loading the panel;
  • describes the loading, error, and empty state of each panel.

Developer:

  • links tablist, tab, and tabpanel, and supports the name of the list and of each panel;
  • updates aria-selected, manages a single entry point, and hides the inactive panels consistently;
  • does not intercept the vertical arrows in a horizontal list without a reason;
  • after a tab is removed dynamically, moves the focus to a logical neighbour or continuation.

Reviewer:

  • enters the list with a single Tab, walks with the arrows including the transition across the edges;
  • observes the focus, the selection, and the displayed panel separately;
  • checks manual or automatic activation, the delay, leaving the list, and returning;
  • repeats the route on a loading error and on the removal of a tab, if these states are provided for.

Expectation in manual testing with a screen reader. The name, role, and selected state of the tab are available, as well as the relationship with the shown panel and the state change after the action. The position in the group is useful to record as an observation, but a single exact phrase should not be set for all screen reader programs.

Boundary of automation. It is possible to check the roles, programmatic relationships, aria-selected values, hidden panels, and part of the focus order. Automation does not confirm the convenience of the activation model, the delay, the announcement of the panel change, and the logical continuation after a removal.

C-05. Disclosure

Open the working C-05 example.

Purpose and boundary. A disclosure consists of a button and a controlled region that becomes visible or hidden. Source model: Disclosure (Show/Hide) Pattern in W3C APG.

States and actions. Collapsed, expanded, collapsed again. If the content is loaded separately, waiting, readiness, and error are added.

Keyboard. The button is activated with Enter and Space. After expanding, the focus usually stays on the button, and the new content appears in a logical reading and focus order. After collapsing, the hidden elements do not remain in the sequential tab order.

Designer:

  • makes the controlling element look visually like a button and shows the state;
  • uses a stable label or a clear pair of labels;
  • places the controlled content next to the button in a logical order;
  • designs nested disclosures and long content without a loss of orientation.

Developer:

  • uses a button and updates aria-expanded on every transition;
  • when needed, links the button and the region through aria-controls;
  • changes the visual visibility, the accessibility tree, and the focus order in sync;
  • does not leave the focus inside a region that has just been hidden.

Reviewer:

  • checks both ways of activation, expanded before and after, and the repeated closing;
  • walks the new content in the expected order;
  • makes sure that the closed elements are unreachable and are not announced as visible;
  • checks the return to the original context after a nested action.

Expectation in manual testing with a screen reader. The name and role of the button, the current disclosure state, and the content that appeared are available. A repeated closing does not leave the person inside a hidden region.

Boundary of automation. It is possible to match the button, aria-expanded, the controlled region, the visibility, and the focusable descendants. A manual route is needed to confirm the clarity of the label, the reading order, the retention of the context, and the actual announcement of the change.

C-06. Upload and notifications

Open the working C-06 example.

Purpose and boundary. The card combines file selection, constraints, start, waiting, progress, success, error, cancellation, retry, and result messages. This is a sequence of states, not a single ARIA widget.

States and actions. No file selected, selected and being validated, rejected, ready for upload, uploading without a determinate percentage, uploading with progress, completed, cancelled, an error occurred, retry available. Notifications are divided into ordinary status ones and urgent ones.

Keyboard. All actions are available without a pointer. The appearance of an ordinary status does not move the focus. An urgent message also must not take the focus on its own; when it is necessary to interrupt the task and get an answer, a separate dialog is used. The model of an ordinary urgent message is described in the Alert Pattern in W3C APG.

Designer:

  • states the permitted types, the size, and other constraints before the selection;
  • distinguishes waiting, determinate progress, success, error, cancellation, and retry;
  • sets the priority of messages and keeps the significant result in an accessible history;
  • does not rely only on a disappearing toast, colour, or animation.

Developer:

  • links the selection field with the instructions and the errors;
  • applies the progressbar role only when it matches the progress model, and updates the name and value without excessive announcements;
  • applies the status role for an ordinary result and the alert role only for an urgent message;
  • manages aria-busy, the message queue, cancellation, and retry consistently with the actual state of the operation.

Reviewer:

  • selects a permitted and a non-permitted file, starts, cancels, and repeats the upload;
  • observes the indeterminate and the determinate progress, the success, and the error;
  • triggers an ordinary and a critical message almost simultaneously and checks the priority, the absence of loss, and the availability of the history;
  • continues typing during a background update and checks whether the work is interrupted by repeating announcements.

Expectation in manual testing with a screen reader. The constraints are known before the selection. A state change is discoverable without moving the focus, the progress does not create a stream of useless repetitions, and the success or the error remain available after a brief notification disappears. Basis: WCAG 2.2, understanding of success criterion 4.1.3 "Status Messages".

Boundary of automation. It is possible to check part of the roles, names, values, programmatic relationships, the focus, and the presence of messages after an action. It is not possible to automatically confirm the priority and the timeliness of the actual announcements, the absence of speech interruption, the clarity of the error, the retention of data, and the convenience of the repeated action.

General boundary of the conclusion

Correct markup of a single state does not confirm the accessibility of a component in all transitions. An automated finding, an expert decision, a manual observation with an assistive technology, and the result of a user session are kept as different types of evidence. The cards become a basis for acceptance only after working examples, reproducible scenarios, and an independent check of the expected results appear.

Interactive component examples

Six examples show the expected states and transitions. They do not replace the manual check with the selected browser, operating system and assistive technology.

C-01. Toggle button

The button keeps its state in aria-pressed and shows or hides the panel below.

The hints are hidden.

C-02. Form with validation

The form names the field that is wrong and says what to do. The message is a text, not only a colour.

Example address

Use a fictional address in the form name@example.com.

C-03. Modal dialog

The dialog keeps the focus inside, closes with the Escape key and returns the focus to the button that opened it.

The dialog is closed.

Delete the draft?

The draft can be restored within 30 days.

C-04. Tabs with a manual activation

The arrow keys move the focus between the tabs, the Enter or the Space key opens the focused tab.

The request is accepted.

C-05. Disclosure

The button keeps the state of the panel in aria-expanded and names the panel it controls.

The terms are hidden.

C-06. Loading and status

The region reports that it is busy and the status region says what happened.

The results are not loaded yet.