Hinode logo
  • About 
  • Docs 
  • Components 
  • Guides 
  • Releases 
  •  
Docs
  • Getting Started
    • Introduction
    • Commands
    • Hosting and Deployment
    • Upgrading
    • Private Modules and Packages
    • Contribute
    • Troubleshooting
  • Content
    • Content Management
    • Content Organization
    • Typography
    • Links and Cross-References
    • Images and Figures
    • Tables
    • Icons
  • Configuration
    • Layout
    • Colors
    • Color Modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Cookie Consent
    • Digital Asset Managers
  • Components
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button Group
    • Card
    • Card Group
    • Carousel
    • Collapse
    • Command Prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Ins
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and Tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Table
    • Timeline
    • Toast
    • Tooltip
    • Video
  • Advanced Settings
    • Overview
    • Styles
    • Scripts
    • Icons
    • Partial Development
    • Module Development
    • Server Headers
    • Server-Side Redirection
  • About
    • Credits
    • License
  • Getting Started
    • Introduction
    • Commands
    • Hosting and Deployment
    • Upgrading
    • Private Modules and Packages
    • Contribute
    • Troubleshooting
  • Content
    • Content Management
    • Content Organization
    • Typography
    • Links and Cross-References
    • Images and Figures
    • Tables
    • Icons
  • Configuration
    • Layout
    • Colors
    • Color Modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Cookie Consent
    • Digital Asset Managers
  • Components
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button Group
    • Card
    • Card Group
    • Carousel
    • Collapse
    • Command Prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Ins
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and Tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Table
    • Timeline
    • Toast
    • Tooltip
    • Video
  • Advanced Settings
    • Overview
    • Styles
    • Scripts
    • Icons
    • Partial Development
    • Module Development
    • Server Headers
    • Server-Side Redirection
  • About
    • Credits
    • License

Accordion

Share via

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:

Name Type Required Default Comment
always-open bool Flag to make accordion items stay open when another item is opened.
class string Class attribute of the accordion, e.g. w-50.
id string ID of the accordion, defaults to accordion-n with a sequential number n.
Name Type Required Default
always-open bool
Flag to make accordion items stay open when another item is opened.
class string
Class attribute of the accordion, e.g. w-50.
id string
ID 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:

Name Type Required Default Comment
class string Class attribute of the accordion item.
header string yes Header of the accordion item.
show bool Flag to indicate an item should be shown as collapsed.
Name Type Required Default
class string
Class attribute of the accordion item.
header string yes
Header of the accordion item.
show bool
Flag 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 >}}
• Update to Hinode v0.27.13 (b6f5054)
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.29.3
Privacy | Cookies
 
Links
Home 
About 
Docs 
Components 
Releases 
Guides
Getting Started 
Developing Modules 
Optimization 
Versioning 
Community
Issues   
Discussions   
Contribute 
Hinode
Link copied to clipboard
Hinode
Code copied to clipboard