ANNOUNCEMENT: Voyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas.
Learn more
Docs Menu

Collapsible Sections

Collapsible sections let you hide and show dynamic content.

A collapsible section contains the following parts:

  1. Section title

  2. Short description of the content in the section

  3. Chevron to expand and collapse the section

  4. Section content

collapsible section anatomy
click to enlarge

The following example shows the syntax for a collapsible section:

.. collapsible::
:heading: Prerequisites
:sub_heading: Complete the previous steps in the tutorial and install dependencies
:expanded:
Body content goes here.

When you create collapsible sections, use the following guidelines:

  • Make the title short and concise.

  • For the subheader, write a very one-line description with a period at the end. Don't exceed one line.

  • Don't hide essential information in a collapsible section. Include only secondary information, like prerequisite and troubleshooting information, in a collapsed section. Use the :expanded: option for sections that should display expanded by default.