HTML-Native Accordions, by @cferdinandi:
HTML-native accordions
Today, I wanted to share a little approach you can use to create accessible, HTML-native accordions (sort of), without any JavaScript. There are going to be included in the new UI library I’m building for people who love HTML, and I wanted to show you how they work. Let’s dig in! <details> and <summary> The <details> and <summary> elements are native HTML elements that create a show/hide component. You put your entire accordion content inside a details element.