Live demo
Demo source
An accordion item is one section of an accordion.
Its header shows itemTitle and an optional subtitle; put your own header
content, such as a name and a status, in the header slot. The panel shows the
content slot, and maxContentHeight makes long content scroll.
Set open to start the item open, and disabled to keep it closed. The parent
accordion decides whether other items close when one opens.
Anatomy
The accordion anatomy shows an item's header and content in the accordion composition.
Content and expansion
The item shares the parent accordion's design guidance; it has no separate
design anatomy or feedback variants. Use one item for a standalone disclosure,
or place related items in an accordion with mode="accordion" for one open
panel or mode="multi" for several.
The design's “is open” maps to open. Its custom header and panel map to the
header and content slots. A header slot replaces both itemTitle and
subtitle. If it contains a section heading, choose one semantic heading
level that fits the page; the built-in title is a span. Keep the panel focused
on that heading's topic.
The open, closed and disabled states follow the surrounding Spark or Ocean theme. The chevron supports keyboard activation, so retain its visible focus indicator when composing a custom header.