How to build an accessible ContainedList in React

The container heading labels the ul/li structure; interactive rows must slot a real button or link via asChild so role and focus are native, not faked on a div

When to use a ContainedList

When not to use it

Keyboard interactions

Role list, verified at WCAG 2.2-AA.

Common mistakes

Avoid: Putting interactive controls on a plain ContainedListItem div

Prefer: Use ContainedListItem asChild with a <button> or <a> so the row is keyboard-focusable

A non-interactive div gives no focus or role semantics to assistive tech

Example

<ContainedList label="Members">
  <ContainedListItem>Ada Lovelace</ContainedListItem>
  <ContainedListItem>Alan Turing</ContainedListItem>
</ContainedList>

See the full ContainedList reference →