Components

The accordion is based on native HTML elements details and summary, which have built-in toggle behavior:

details

creates a disclosure widget in which information is visible only when the widget is toggled into an open state. A summary or label must be provided using the summary element.

name attribute of the details element is being utilized to construct an exclusive accordion, which consists of a set of details elements. When a user triggers an action to open one details element, any other open details elements with the same name attribute are automatically closed.

summary
specifies a summary, caption, or legend for a details element's disclosure box. Clicking the summary element toggles the state of the parent details element open and closed.

By adding or removing the open attribute of the details element, you can programmatically toggle the state of the accordion.

<details open name="accordions">
	<summary>Open for Instant Smiles, Handle With Glee!</summary>
		<div>Welcome to the world of tomorrow!</div>
</details>
<details name="accordions">
	<summary>Open for Instant Smiles, Handle With Glee!</summary>
		<div>Hi there!</div>
</details>
<details name="accordions">
	<summary>Open for Instant Smiles, Handle With Glee!</summary>
		<div>Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace
		for grins!</div>
</details>
Open for Instant Smiles, Handle With Glee!
Welcome to the world of tomorrow!
Open for Instant Smiles, Handle With Glee!
Hi there!
Open for Instant Smiles, Handle With Glee!
Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace for grins!

When the attribute role="button" is used on the summary element, the accordion opener turns into a button.
Open for Instant Smiles, Handle With Glee!
Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace for grins!
Open for Instant Smiles, Handle With Glee!
Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace for grins!
Open for Instant Smiles, Handle With Glee!
Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace for grins!
<details >
	<summary role="button" class="s-secondary">Open for Instant Smiles, Handle With Glee!</summary>
		<div>Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace
		for grins!</div>
</details>
<details >
	<summary role="button" class="s-outline">Open for Instant Smiles, Handle With Glee!</summary>
		<div>Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace
		for grins!</div>
</details>
<details >
	<summary role="button">Open for Instant Smiles, Handle With Glee!</summary>
		<div>Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace
		for grins!</div>
</details>

When a details element is the only child of an article, it becomes an article accordion. If you wrap the content of the details (excluding summary) into an element, padding is applied to it automatically.
Open for Instant Smiles, Handle With Glee!
Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace for grins!
<article role="presentation">
	<details>
		<summary role="button">Open for Instant Smiles, Handle With Glee!</summary>
		<div>Unleash pure joy with surprise goodies that guarantee laughter. It's happiness in a box—brace
		for grins!</div>
	</details>
</article>

Modal title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum harum laborum quo vero veritatis eaque similique fuga quae, repudiandae, necessitatibus dolorem facere obcaecati beatae architecto expedita laboriosam cumque numquam inventore. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum harum laborum quo vero veritatis eaque similique fuga quae, repudiandae, necessitatibus dolorem facere obcaecati beatae architecto expedita laboriosam cumque numquam inventore.

Dialog title

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Asperiores vitae officia, voluptatem modi quos quisquam similique tenetur voluptatum, ratione suscipit numquam dolore aperiam molestiae impedit. Ut, maiores? Alias, quos facilis.