Overview of Bento Accordion
mainThe Bento Accordion is a component that displays content sections that can be collapsed and expanded. It allows users to view a content outline and jump to specific sections, which helps reduce scrolling on mobile devices.
Structural Requirements:
- The component accepts one or more
<section>elements as direct children. - Each
<section>must contain exactly two direct children:- Heading: The first child must be a heading element (e.g.,
<h1>through<h6>) or a<header>element. - Content: The second child is the expandable/collapsible content, which can be any valid AMP HTML tag.
- Heading: The first child must be a heading element (e.g.,
- Clicking or tapping a heading toggles the expansion state of its associated section.
- If the Bento Accordion has a defined
id, it will preserve the collapsed or expanded state of each section as long as the user remains on the same domain.