Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.ui

Support keyboard interaction for click handlers

Non-interactive JSX elements that respond to clicks also need an equivalent keyboard path.

#Metadata

Rule ID
ts.react.no-click-without-keyboard-handler
Severity
high
Confidence
0.84
Languages
javascript, typescript
Presets
strict
Stability
experimental
Applies to
function
Tags
accessibility, react, rules-catalog, ui

#Why it matters

Mouse-only interaction blocks keyboard users and creates inaccessible custom controls that do not behave like native UI elements.

#Remediation

Prefer native buttons or links, or add the necessary role, focus behavior, and keyboard handlers for the same action.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-click-without-keyboard-handler.rule.yaml.