Details
Collapsible sections using the native HTML details element. No JavaScript required.
The details shortcode wraps content in a native HTML <details>/<summary> element. No JavaScript is needed. The browser handles expand and collapse.
Usage
Pass the summary title as the first argument:
{{< details "What is Bora?" >}}
Bora is a Hugo theme for technical documentation.
{{< /details >}}What is Bora?
Bora is a Hugo theme for technical documentation.
Open by default
Add open=true to render the section expanded on load:
{{< details title="Already open" open=true >}}
This section is expanded by default.
{{< /details >}}Already open
This section is expanded by default.
Markdown inside
The inner content is rendered as full Markdown, so you can include headings, lists, code blocks and other shortcodes:
{{< details "Configuration options" >}}
| Option | Default | Description |
|--------|---------|-------------|
| `baseURL` | (none) | The root URL of your site. |
| `title` | (none) | Site title shown in the browser tab. |
{{< /details >}}Configuration options
| Option | Default | Description |
|---|---|---|
baseURL |
(none) | The root URL of your site. |
title |
(none) | Site title shown in the browser tab. |
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
First positional / title |
string | "Details" |
Text shown in the summary bar. |
open |
bool | false |
Start the section expanded. When used, pass title as a named parameter too. |
Was this page helpful?
Thanks for your feedback!