This content is hidden until the user clicks the summary.
Another expandable section
More hidden content here.
Open by default
This section starts expanded.
Dialog (Native Modal)
Progress & Meter
Figure & Media
Figure caption describing the image above.Picture element with dark mode variant.
Article Card Pattern
Card Title
This article element can be styled as a card component without any classes.
Aside (Sidebar/Callout)
Navigation Patterns
Breadcrumb
Tabs (with Alpine.js)
Pagination
Search Pattern
Embedded Content
Embedded map using iframe.
Prose Example
On the Merits of Semantic HTML
The web was built on documents. Before the JavaScript frameworks, before CSS-in-JS, before the build tools—there was just HTML. And it was enough.
Today we've forgotten this. We reach for div and span like they're the only elements that exist. We add classes like .card, .btn, .text-lg until our markup becomes unreadable. But there's another way.
The Case for Native Elements
Consider the humble <details> element. It gives you an accordion for free—no JavaScript required. Or <dialog>, which handles modals with proper focus trapping and backdrop. These aren't obscure features; they're part of the platform.
The best code is no code at all. Every line of code you write is a liability.
Reduced JavaScript (native behaviors are already implemented)
Better SEO (search engines parse semantic structure)
Easier styling (target elements, not classes)
A Practical Example
Let's say you need a FAQ section. The typical approach involves custom JavaScript, ARIA attributes, and careful state management. Or you could write this:
<details>
<summary>How do I get started?</summary>
<p>Just include the CSS file and write HTML.</p>
</details>
That's it. The browser handles the rest. Click the summary, content appears. Click again, it hides. Keyboard accessible. Screen reader friendly. Zero JavaScript.
The Philosophy
This isn't about being a purist. It's about choosing the right tool for the job. Sometimes you need React. Sometimes you need a CSS framework. But often—more often than we admit—plain HTML is enough.
The next time you reach for a component library, ask yourself: does the platform already solve this? You might be surprised how often the answer is yes.
Page Structure Elements
These elements define the semantic structure of a page:
<header>
Page or section header, typically contains nav and branding