Skip to content

List ​

catnip-list applies listbox or menu semantics to its body and rows, but keyboard logic stays in the parent. You choose the role, provide an accessible name when there is no visible title, and manage focus between rows.

Keyboard ​

  • Keyboard logic stays in the parent (see Dropdown for a reference implementation).
  • For listbox, row controls use tabindex="-1"; move focus with a roving tabindex or aria-activedescendant in the parent.
  • For listbox roving focus / aria-activedescendant, set listItemId on the active row and active on catnip-list-item.
  • Parent keyboard logic should skip dividers when moving active / aria-activedescendant.

Screen readers ​

PartSemantics
ListlistRole on the list: listbox for pickers, menu for action menus.
Rowsoption rows in a listbox, menuitem rows in a menu.
Dividerscatnip-divider with default decorative, so separators do not affect option counts.

What you own ​

  • Role: Match listRole on the list to semantics: listbox + option rows, or menu + menuitem rows.
  • Name: Provide listAriaLabel or ariaLabelledby when there is no visible title.
  • Focus: Implement the keyboard logic and focus movement in the parent (see Keyboard).
  • Dividers: Keep dividers decorative (default) inside listbox/menu panels.
  • Danger rows: Set intent="danger" on the item; do not rely on colour alone.

Catnip Design System by Signicat