Use the details shortcode to render a native HTML <details> disclosure element. The summary is always visible; the body is revealed on click.

Usage

{{< details "Summary text" >}}
Body content goes here.
{{< /details >}}

Pass open as a second positional argument to expand the element by default:

{{< details "Summary text" "open" >}}
This content is visible by default.
{{< /details >}}

Parameters

PositionRequiredDescription
0YesSummary label. Supports Markdown.
1NoHTML attributes added to the <details> element, e.g. open.

Inner content is required and supports Markdown.

Examples

Collapsed (default)

Preview
What is Doks?Doks is a Hugo theme for building documentation websites.
{{< details "What is Doks?" >}}
Doks is a Hugo theme for building documentation websites.
{{< /details >}}

Expanded by default

Preview
Prerequisites
{{< details "Prerequisites" "open" >}}

- [Hugo](https://github.com/gohugoio/hugo/releases/latest) (latest extended or extended/deploy edition)
- [Thulite](https://github.com/thuliteio/thulite/releases/latest) (latest version)
- [Node.js/npm](https://nodejs.org/en/download) (latest LTS version)
{.mb-0}
{{< /details >}}