Accessibility
3 Nov 2026
13 min read

Building Accessible Components: WCAG 2.1 AA Compliance in SpaceZero

How SpaceZero components meet accessibility standards including keyboard navigation, screen readers, and touch targets.

Building Accessible Components

SpaceZero components are designed for WCAG 2.1 AA compliance.

Touch Targets (WCAG 2.5.5)

Generous padding on interactive elements via scaling tokens:

tsx

// Button

px-3 py-2

 

// Input

px-3 py-2

 

// Select trigger / option

px-3 py-2

 

// Textarea

px-3 py-3 (min-h-16)

 

// Modal close

p-2

Keyboard Navigation

Focus Management

Focus is indicated by a border color change (no ring utilities):

tsx

focus:border-regular focus-visible:outline-none

Tab Order

Logical tab order through semantic HTML and tabIndex.

Escape Key

Modals are closed via the ModalClose button — there is no global Escape handler in the template. Add a keydown listener in your app shell if you need Escape-to-close.

Screen Reader Support

ARIA Attributes

tsx

// Select

role="combobox"

aria-expanded={open}

aria-selected={isSelected}

 

// Accordion

aria-expanded={isOpen}

 

// Tabs

role="tab"

aria-selected={isActive}

aria-controls={panelId}

Live Regions

Toasts use a polite live region:

tsx

<div role="status" aria-live="polite">

Labels

All inputs have associated labels:

tsx

<label htmlFor="email">Email</label>

<Input id="email" ... />

Color Contrast

Design tokens ensure 4.5:1 contrast ratio:

css

--regular: #ffffff; /* on --surface: #121212 */

--muted: #a4a4a4; /* on --surface: #121212 */

--action: #006198; /* on --surface: #121212 */

Form Validation

tsx

<Input

aria-invalid={!!error}

aria-describedby={error ? 'email-error' : undefined}

/>

{error && <span id="email-error" role="alert">{error}</span>}

Reduced Motion

The template does not ship a prefers-reduced-motion block. If you add animations, include:

css

@media (prefers-reduced-motion: reduce) {

.spinner { animation: none; }

}

Testing Checklist

  • [ ] Navigate entire app with keyboard only
  • [ ] Test with NVDA/JAWS/VoiceOver
  • [ ] Verify focus indicators visible
  • [ ] Check color contrast ratios
  • [ ] Test zoom up to 200%
  • [ ] Verify touch targets on mobile
  • [ ] Test with prefers-reduced-motion

Component Audit

ComponentKeyboardARIAFocusContrast
Button
Input
Select
Modal
Accordion
Tabs
Toast
Toggle