Skip to content

Rule · Accessibility

List contains invalid children

a11y/listwarnvoid a11yupdated

Why it matters

A <ul>/<ol> may contain only <li> (plus script/template). Other children break list semantics, so screen readers announce the wrong item count.

How to fix it

Wrap every direct child of the list in <li>, and move wrappers such as divs inside the <li>.

Example

tsx
<ul>
  <li><a href="/docs">Docs</a></li>
</ul>

References

void a11y reports 48 rules in this category. WCAG 2.2 AA through axe-core, plus checks axe can't do alone: visible keyboard focus, 24/44px target size on mobile, 320px reflow and disabled zoom.