Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.ui

Pair interactive roles with focus behavior

Custom elements that declare widget roles need to enter the tab order unless they wrap a native focusable control.

#Metadata

Rule ID
ts.react.no-widget-role-without-tabindex
Severity
high
Confidence
0.83
Languages
javascript, typescript
Presets
strict
Stability
experimental
Applies to
function
Tags
accessibility, react, rules-catalog, ui

#Why it matters

ARIA widget roles without `tabIndex` are inert to keyboard users because the browser never sends them focus events.

#Remediation

Add `tabIndex={0}` for simple widgets, or prefer native elements like `button` and `a` with real `href` values.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-widget-role-without-tabindex.rule.yaml.