Hinode logo
  • About 
  • Docs 
  • Components 
  • Guides 
  • Releases 
  •  
  •    Toggle theme
    •   Light
    •   Dark
    •   Auto
  •  
    •   Light
    •   Dark
    •   Auto
Docs
    • Introduction
    • Commands
    • Hosting and deployment
    • Upgrading
    • Contribute
    • Troubleshooting
    • Content management
    • Content organization
    • Typography
    • Links and cross-references
    • Images and figures
    • Tables
    • Icons
    • Layout
    • Colors
    • Color modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button group
    • Card
    • Card group
    • Carousel
    • Collapse
    • Command prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Timeline
    • Toast
    • Tooltip
    • YouTube
    • Overview
    • Styles
    • Scripts
    • Icons
    • Module development
    • Server headers
    • Server-side redirection
    • Credits
    • License
    • Introduction
    • Commands
    • Hosting and deployment
    • Upgrading
    • Contribute
    • Troubleshooting
    • Content management
    • Content organization
    • Typography
    • Links and cross-references
    • Images and figures
    • Tables
    • Icons
    • Layout
    • Colors
    • Color modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button group
    • Card
    • Card group
    • Carousel
    • Collapse
    • Command prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Timeline
    • Toast
    • Tooltip
    • YouTube
    • Overview
    • Styles
    • Scripts
    • Icons
    • Module development
    • Server headers
    • Server-side redirection
    • Credits
    • License

Accordion

Share via
Hinode
Link copied to clipboard

Use the accordion shortcode to show a group of vertically collapsing and expanding items.

On this page
 

  • Overview
  • Arguments
  • Examples
    • Flush
    • Always open

Overview  

Use the accordion shortcode to show a group of vertically collapsing and expanding items. Add accordion-item inner elements for each accordion item.

This is the first item’s accordion body. It supports Markdown content. The item is shown by adding the value show to the class argument.

This is the second item’s accordion body. It too supports Markdown content.

This is the third item’s accordion body.
markdown
{{< accordion id="accordion-default" >}}
  {{< accordion-item header="Accordion Item #1" show="true" >}}
    This is the first item's accordion body. It supports Markdown content. The item is shown by
    adding the value `show` to the `class` argument.
  {{< /accordion-item >}}
  {{< accordion-item header="Accordion Item #2" >}}
    This is the second item's accordion body. It too supports Markdown content.
  {{< /accordion-item >}}
  {{< accordion-item header="Accordion Item #3" >}}
    This is the third item's accordion body.
  {{< /accordion-item >}}
{{< /accordion >}}

Arguments  

The shortcode supports the following arguments:

NameTypeRequiredDefaultComment
always-openboolFlag to make accordion items stay open when another item is opened.
classstringClass attribute of the accordion, e.g. w-50.
idstringID of the accordion, defaults to accordion-n with a sequential number n.

Add an inner accordion-item element for each item of the accordion. The accordion-item element supports the following arguments:

NameTypeRequiredDefaultComment
classstringClass attribute of the accordion item.
headerstringyesHeader of the accordion item.
showboolFlag to indicate an item should be shown as collapsed.

Examples  

Change the style of your accordion with class attributes and arguments.

Flush  

Add .accordion-flush to remove some borders and rounded corners to render accordions edge-to-edge with their parent container.

This is the first item’s accordion body. It supports Markdown content. The item is shown by adding the value show to the class argument.

This is the second item’s accordion body. It too supports Markdown content.

This is the third item’s accordion body.
markdown
{{< accordion id="accordion-flush" class="accordion-flush" >}}
  {{< accordion-item header="Accordion Item #1" >}}
    This is the first item's accordion body. It supports Markdown content. The item is shown by
    adding the value `show` to the `class` argument.
  {{< /accordion-item >}}
  {{< accordion-item header="Accordion Item #2" >}}
    This is the second item's accordion body. It too supports Markdown content.
  {{< /accordion-item >}}
  {{< accordion-item header="Accordion Item #3" >}}
    This is the third item's accordion body.
  {{< /accordion-item >}}
{{< /accordion >}}

Always open  

Set always-open to true to make accordion items stay open when another item is opened.

This is the first item’s accordion body. It supports Markdown content. The item is shown by adding the value show to the class argument.

This is the second item’s accordion body. It too supports Markdown content.

This is the third item’s accordion body.
markdown
{{< accordion id="accordion-always-open" always-open="true" >}}
  {{< accordion-item header="Accordion Item #1" >}}
    This is the first item's accordion body. It supports Markdown content. The item is shown by
    adding the value `show` to the `class` argument.
  {{< /accordion-item >}}
  {{< accordion-item header="Accordion Item #2" >}}
    This is the second item's accordion body. It too supports Markdown content.
  {{< /accordion-item >}}
  {{< accordion-item header="Accordion Item #3" >}}
    This is the third item's accordion body.
  {{< /accordion-item >}}
{{< /accordion >}}
Last updated: December 29, 2023 • Move arguments to data structure (f85b335)
On this page
  • Overview
  • Arguments
  • Examples
    • Flush
    • Always open
Accordion
Accordion
Hinode is a clean documentation and blog theme for your Hugo site based on Bootstrap 5.
Code licensed MIT, docs CC BY-NC 4.0
Currently v0.22.0-beta6
 
Links
Home 
About 
Docs 
Components 
Releases 
Guides
Getting started 
Developing modules 
Optimization 
Versioning 
Community
Issues   
Discussions   
Contribute 
Hinode
Code copied to clipboard