<Accordion />has uncontrolled behaviour - meaning it will be expanding tabs as usual when the user clicks on tab titles. Once the
<Accordion />is focused, tabs can also be expanded/collapsed via keyboard interaction. You can use
Arrow up/downto navigate between tabs, and hit
Enterto expand/collapse the currently focused tab.
<Accordion />, you can use the
activeIndexprop. When using the controlled behaviour, you need to make sure you update the value of
onExpand(activeIndex)) is triggered.
onActivate(activeIndex)is called whenever
onExpand(expandIndex)is called, plus, in accordions with
onActivate(activeIndex)is also called when an expanded tab is collapsed.
defaultActiveIndex. In this case, the
<Accordion />will store the active tabs in its own internal state.