Accordion

Accessibility

Accessibility Props

NameTypeDefaultDescription
loadingTitlestringThe title announced by screen readers when the accordion is in loading state. Required when loading is true and loadingHidden is not true.
loadingHiddenbooleanIf true, the loading state will be hidden from screen readers. Use when loading state is conveyed through other visible text on the page.
NameTypeDefaultDescription
expandOnTileClickbooleanfalseWhen true, makes the entire header area clickable to expand/collapse the section, improving the touch target size for mobile users.

Automatic Accessibility Features

  • The component automatically manages ARIA attributes when a section is expandable AND expandOnTileClick is true:
    • role="button" is applied to the header
    • aria-expanded is set to true or false based on the section’s expanded state
    • aria-controls associates the header with its controlled content section
    • tabIndex is set to 0 to include the header in the tab order

Keyboard Navigation

  • Enter/Space: When focus is on a section header with expandOnTileClick enabled, pressing Enter or Space will toggle the expansion state
  • Tab: Moves focus to the next focusable element (header or interactive elements within expanded sections)
  • Shift + Tab: Moves focus to the previous focusable element

Loading state accessibility

  • Use loadingTitle to provide a descriptive message that will be announced to screen readers
  • Use loadingHidden to hide the loading state from screen readers when the loading state is conveyed through other visible text on the page
// Accessible loading state with descriptive message
<Accordion
loading
loadingTitle="Loading accordion content"
>
<AccordionSection header="Section 1">Content 1</AccordionSection>
<AccordionSection header="Section 2">Content 2</AccordionSection>
</Accordion>
// Loading state hidden from screen readers because loading state
// is conveyed through other visible text on the page
<Accordion
loading
loadingHidden
>
<AccordionSection header="Section 1">Content 1</AccordionSection>
<AccordionSection header="Section 2">Content 2</AccordionSection>
</Accordion>

Best Practices

  • Provide descriptive headers that clearly indicate the content of each section
  • Consider enabling expandOnTileClick for interfaces primarily used on mobile devices
  • Interactive elements in the main content area should only be accessible when their section is expanded

Example

<Accordion id="faq-accordion">
<AccordionSection id="section-1" header="What is Orbit?" expandOnTileClick>
Orbit is Kiwi.com's design system for creating consistent user experiences across products.
</AccordionSection>
<AccordionSection id="section-2" header="How do I use Accordion?" expandOnTileClick>
Import the Accordion and AccordionSection components and nest the sections within the accordion.
</AccordionSection>
</Accordion>