Accessibility, Internationalisation and Security

Topics Covered

Semantic HTML and ARIA

Why accessibility is a design requirement

The accessibility tree

Semantic elements first

ARIA roles, states and properties

The first rule of ARIA and common misuse

Testing and verification

Forms and error messages

Accessibility, internationalisation and security are the three cross cutting concerns that most often separate a strong frontend design answer from an average one. None of them is a feature on the wireframe. Each one touches every component, and each one is expensive to add after the fact. An interviewer who hears you design a dialog, a menu or a feed will often ask one probing question in this area: how does a keyboard user get here, what happens to this layout in Arabic, or what stops a malicious comment from running script in someone else's session? This lesson gives you mechanisms for all three, starting with the foundation of accessibility, which is the markup itself.

Why accessibility is a design requirement

Roughly one in six people lives with some form of disability, and far more people are temporarily or situationally impaired: a broken wrist, a phone in bright sunlight, a noisy train. Users navigate with keyboards, switch devices, screen readers, screen magnifiers, voice control and high zoom. A design that only works with a mouse and good eyesight excludes them. Accessibility is also a legal requirement in many markets. The Web Content Accessibility Guidelines, WCAG, are the reference standard, and version 2.2 at level AA is the common target for public sector and large commercial sites. In the European Union the European Accessibility Act has applied to many consumer facing digital services since mid 2025, and in the United States accessibility lawsuits against websites are routine.

For the interview, the useful framing is that accessibility is a non functional requirement you state in step one, alongside performance budgets and supported browsers. Say that the product targets WCAG 2.2 AA, and then let that requirement show up in your component designs. The deeper mechanics of how you scope requirements belong to the requirements lesson; here we focus on how you meet them.

The accessibility tree

Browsers build two trees from your markup. The DOM tree drives what is painted. The accessibility tree is a parallel structure that the operating system exposes to assistive technology. Each node in it has a role, such as button, link, heading, textbox, list or dialog; an accessible name, such as Save or Search products; a state, such as expanded, checked, selected or disabled; and sometimes a value or a description. A screen reader does not see your pixels. It reads this tree and announces something like Save, button, or Filters, collapsed, button.

The browser builds an accessibility tree from your markup, and semantic elements give it roles for free.

The tree is computed mostly from semantics. A real button element arrives with the button role, takes its name from its text content, is focusable by default and fires its click handler on Enter and Space. A div with a click handler gets a generic role and no name, cannot be reached with Tab and ignores the keyboard. It looks identical on screen and is useless to a large group of users. To make the div equivalent you would need a role attribute, a tabindex, key handlers for Enter and Space, a visible focus style and correct disabled behaviour. That is five things to remember on every instance, which is why teams that use divs as buttons end up with bugs scattered across the product.

Semantic elements first

The cheapest and most robust accessibility work is choosing the right element. Use buttons for actions and links for navigation; a link changes the URL and supports opening in a new tab, while a button does something on the current page. Use headings in a real hierarchy so screen reader users can jump between sections, which is how many of them skim a page. Use landmark elements, header, nav, main, aside and footer, so users can jump straight to the main content. Use lists for lists, so a feed announces list, 20 items. Use label elements tied to inputs, fieldset and legend for groups of radio buttons, and real table markup for tabular data.

html
1<main>
2  <h1>Orders</h1>
3  <form>
4    <label for="q">Search orders</label>
5    <input id="q" type="search" />
6    <button type="submit">Search</button>
7  </form>
8  <ul aria-label="Recent orders">
9    <li><a href="/orders/812">Order 812, shipped</a></li>
10  </ul>
11</main>

Images need text alternatives. A meaningful image gets an alt attribute that says what it conveys; a decorative image gets an empty alt so the reader skips it. An icon only button, such as a trash can, needs an accessible name from visually hidden text or an aria-label, otherwise it announces as button with no name.

ARIA roles, states and properties

ARIA, the Accessible Rich Internet Applications specification, is a set of attributes that change what the accessibility tree says about an element. It does not change behaviour. Adding a button role to a div does not make it respond to Enter; you still write that code. ARIA is the tool for widgets that HTML has no element for, such as tabs, comboboxes, tree views, menus with submenus and grids.

ARIA has three kinds of attributes. Roles say what a thing is: tablist, tab, tabpanel, combobox, listbox, option, menu, menuitem, dialog, alert. States describe current conditions that change: aria-expanded, aria-selected, aria-checked, aria-pressed, aria-busy. Properties describe relationships and labels: aria-label, aria-labelledby, aria-describedby, aria-controls, aria-activedescendant. A disclosure button for a filter panel, for example, carries aria-expanded set to false or true and aria-controls pointing at the panel id, and your component flips aria-expanded whenever the panel opens. The ARIA Authoring Practices Guide describes the expected roles, states and keyboard behaviour for each common widget, and in an interview it is enough to say you would follow its pattern for the combobox or the tabs and then name the key parts.

The first rule of ARIA and common misuse

The first rule of ARIA is not to use it when a native element would do. Surveys of large numbers of home pages have repeatedly found that pages with ARIA tend to have more detected accessibility errors than pages without it, because ARIA is easy to apply incorrectly. Common mistakes include putting a role on an element and forgetting the keyboard behaviour the role promises; using aria-hidden on something that can still receive focus, so the user lands on an invisible element; labelling everything with aria-label so the visible text and the spoken text drift apart, which breaks voice control users who say the visible label; and states that never update, such as aria-expanded stuck on false.

A good rule for a design system is that every interactive primitive, button, link, input, select, checkbox, dialog, menu, tabs and combobox, is built once with correct semantics and keyboard support, tested with real assistive technology and reused everywhere. Product teams then compose these primitives and rarely write ARIA themselves. This is also a strong point to make in the component architecture step of an interview: accessibility lives in the shared components, so product code inherits it.

Testing and verification

Automated checkers such as axe, Lighthouse and lint rules for JSX catch a meaningful share of issues: missing labels, low contrast, invalid ARIA, images without alt text. They cannot judge whether the focus order makes sense or whether an announcement is helpful, so manual testing still matters. A practical plan is automated checks in continuous integration on every pull request, a keyboard only pass on each new screen, and periodic screen reader testing with VoiceOver on macOS and iOS, NVDA or JAWS on Windows and TalkBack on Android. Mentioning that plan in the wrap up of an interview shows that you treat accessibility as something verified, not just intended.

Forms and error messages

Forms are where accessibility failures cost the most, because a user who cannot complete a sign up or a checkout simply leaves. Every input needs a visible label tied to it, not just placeholder text, which disappears as soon as the user types and is often too low in contrast. Required fields are marked in text as well as colour. When validation fails, the error message appears next to the field, is linked to it with aria-describedby so the reader announces it when the field is focused, and the field carries aria-invalid set to true. On submit, move focus to the first invalid field or to an error summary at the top that links to each field. Never rely on colour alone to signal an error; a red border is invisible to many colour blind users, so pair it with an icon and text. Use the right input types and autocomplete attributes, such as email, tel and one time code, so mobile keyboards and password managers help instead of fighting the user.

Accessibility lives in the primitives

If the design system's button, dialog, menu and combobox are built with correct roles, names and keyboard behaviour, every product screen inherits them. Say this in the component architecture step and the interviewer hears that accessibility scales with the team, not with individual effort.