Boolean/toggle filters render as checkbox or switch with labels
Why it matters
Boolean filters rendered as clickable divs or unsemantic buttons fail WCAG 2.2 SC 4.1.2 (Name, Role, Value) and SC 1.3.1 (Info and Relationships) — a screen reader user lands on a div that says "Has WiFi" with no indication it is togglable, interactable, or currently active. This eliminates the filtering experience entirely for keyboard-only and assistive technology users. Beyond accessibility, div-based toggles break browser default behaviors: they don't receive focus in the correct tab order, don't respond to Space or Enter as checkboxes do, and don't participate in form submission.
Severity rationale
Low because the failure blocks screen reader and keyboard users from accessing filters without creating a security or data integrity risk.
Remediation
Render every boolean filter as a native <input type="checkbox"> wrapped in a <label>. In components/BooleanFilters.tsx:
<label className="flex items-center gap-2">
<input
type="checkbox"
checked={filters.hasWifi || false}
onChange={() => toggleFilter('hasWifi')}
/>
<span>Has WiFi</span>
</label>
Native checkboxes handle Space/Enter toggling, :checked state, and screen reader announcements without custom ARIA. If you need a styled toggle switch, use shadcn/ui's Switch component, which wraps a checkbox with full role="switch" semantics.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Search & Discovery UX Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- wcag:2.2 · 4.1.2 — Name, Role, Value
- wcag:2.2 · 1.3.1 — Info and Relationships
Taxons
History
- 2026-04-18·v1.0.0·Initial import from directory-search-discovery·automated