, (2) Save state between steps, (3) Allow backward navigation. Complex inputs: (1) Date pickers: provide text input fallback, native support best. (2) Autocomplete: aria-autocomplete="list" aria-controls="suggestions",
Use ARIA to make custom controls accessible to assistive technologies. Custom checkbox: <div role="checkbox" aria-checked="false" tabindex="0" @click="toggle" @keydown.space.prevent="toggle">✓
. Required attributes: role defines element type, aria-checked (true/false/mixed) for state, tabindex="0" for keyboard focus, keyboard handlers (Space/Enter). Custom select dropdown:
Option 1
. Required: role="combobox" container, aria-expanded for dropdown state, aria-activedescendant for selected option, role="listbox" and role="option", keyboard navigation (Arrow keys, Enter, Escape). Custom slider:
. Arrow keys adjust value, Home/End for min/max. Best practices: (1) Use native HTML when possible (), (2) Follow WAI-ARIA Authoring Practices patterns, (3) Implement full keyboard support, (4) Provide clear focus indicators, (5) Test with screen readers (NVDA, JAWS, VoiceOver), (6) Include value change announcements (aria-live). Common mistakes: (1) Missing keyboard support, (2) Incorrect ARIA roles, (3) No focus management, (4) Poor screen reader announcements. Alternative: use accessible component libraries (Radix UI, Headless UI, Reach UI) with built-in accessibility.
Implement WCAG 2.1 compliant keyboard navigation for full accessibility. Core requirements: (1) All interactive elements accessible via keyboard (Tab, Shift+Tab, Enter, Space, Arrow keys), (2) No keyboard traps (users can navigate away from any element), (3) Visible focus indicators (3:1 contrast ratio minimum against background). Key patterns: Tab/Shift+Tab navigate between focusable elements (buttons, links, inputs), Enter activates buttons and links, Space toggles checkboxes and activates buttons, Arrow keys navigate within dropdowns, radio buttons, sliders, Escape closes modals and menus. HTML semantics: use native elements for free keyboard support:
Accessibility ensures web content is usable by everyone including people with disabilities. Importance: (1) Legal compliance: ADA Title III and Section 508 require accessibility in US, WCAG 2.1 is international standard, lawsuits increasing for non-compliance, (2) Expanded audience: 15% of world population has disabilities, elderly users need accessible design, temporary disabilities (broken arm, eye strain), (3) Better UX for all: keyboard navigation helps power users, captions help in noisy environments, clear language helps non-native speakers. WCAG 2.1 principles (POUR): (1) Perceivable: text alternatives for images, captions for videos, sufficient color contrast (4.5:1 for text), (2) Operable: keyboard accessible, enough time to interact, no seizure-inducing content, (3) Understandable: readable text, predictable behavior, error prevention and correction, (4) Robust: compatible with assistive technologies (screen readers, magnifiers). Key practices: semantic HTML (,
Implement internationalization (i18n) with proper language metadata and content structure. HTML lang attribute: for primary language, Hola for inline changes, screen readers use this for pronunciation. Vue i18n setup: const i18n = createI18n({ locale: 'en', fallbackLocale: 'en', messages: { en: { greeting: 'Hello' }, es: { greeting: 'Hola' } } });. Usage: {{ $t('greeting') }} or const { t } = useI18n(); t('greeting');. Language switcher: <select @change="changeLocale" aria-label="Select language">. Store preference: localStorage.setItem('locale', locale); persist across sessions. RTL support: for Arabic, Hebrew, etc., CSS logical properties: margin-inline-start instead of margin-left, flexbox and grid automatically adjust. Pluralization: { "apple": "no apples | one apple | {count} apples" }, $t('apple', count). Number/date formatting: {{ n(1000, 'currency') }} → $1,000.00 (locale-aware), {{ d(date, 'long') }} → January 15, 2025. Accessibility considerations: (1) Set lang on dynamically loaded content, (2) Announce language changes to screen readers:
Language changed to Spanish
, (3) Translate ARIA labels and descriptions, (4) Test with screen readers in each language. SEO: separate URLs per language (/en/, /es/) or subdomains (en.example.com), hreflang tags: . Best practices: (1) Externalize all text (no hardcoded strings), (2) Load translations lazily per route, (3) Detect browser language: navigator.language, (4) Provide manual language selector, (5) Test layout with long translations (German, Finnish).