Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
sphinx-design-elements
sphinx-design-elements
  • README
  • Getting Started

Directives

  • Grid Table
  • Info Card
  • Shield
  • Link Tree

Roles

  • Hyper
  • Tag

Styling

  • CSS Classes
  • Dropdown Group

Development

  • Project information
  • Change Log
  • Sandbox
Back to top
View this page

Dropdown Group¶

About¶

This is an extension to sphinx-design dropdowns, intending to implement a similar behavior like using CSS toggle-group to group exclusive toggles.

If you have multiple dropdown elements, you can group them together, in order to make only one toggle from the group active at a time, effectively defining exclusive dropdowns.

This is similar to how HTML radio buttons behave, where two buttons cannot be checked at the same time.

Usage¶

In order define a group of multiple dropdown elements that should exclusively open when toggled, wrap them into a container element using the dropdown-group class.

::::{div} dropdown-group

:::{dropdown} Dropdown A
Dropdown content A
:::

:::{dropdown} Dropdown B
Dropdown content B
:::

::::
.. div:: dropdown-group

    .. dropdown:: Dropdown A

        Dropdown content A

    .. dropdown:: Dropdown B

        Dropdown content B

Example¶

Dropdown A

Dropdown content A

Dropdown B

Dropdown content B

Next
Project information
Previous
CSS Classes
Copyright © 2023-2025, Panodata Developers
Made with Sphinx and @pradyunsg's Furo
On this page
  • Dropdown Group
    • About
    • Usage
    • Example