WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Happy Prime v3.1.0

Show / Hide Section Block

Display an accessible show/hide interface with details and summary elements.

Show / Hide Section Block

The facts

Rating
5★ from 1
Active installs
100+
Price
Free
Last updated
8 May 2025
Added
Mar 2023
Requires WP
6.4
Tested up to
WP 6.8.8
Requires PHP
7.4
Downloads
2,681

Our analysis

AI-assisted

Show / Hide Section Block is a WordPress plugin that allows you to create collapsible sections of content using a group of details elements. It provides four distinct blocks: Show Hide Group, Show Hide Section, Show Hide Summary, and Show Hide Details, which you can use to structure your content effectively.

This plugin is suitable for users who want to organise information in a way that allows visitors to expand or collapse sections as needed. It is particularly useful for FAQs, tutorials, or any content that benefits from a summarised view with additional details available on demand.

Best for: This plugin is best for websites that need to display large amounts of information in a compact format.

What it does well

  • Creates collapsible content sections
  • Includes a toggle button for expanding/collapsing all sections
  • Utilises standard HTML elements for accessibility
  • Free to use from the WordPress.org directory

Where it falls short

  • Limited information on advanced features or customisation options

Verdict

Show / Hide Section Block offers a straightforward solution for managing collapsible content, making it a practical choice for users looking to enhance their site's information presentation.

From the developer

Happy Prime's own description of Show / Hide Section Block, lightly tidied.

Show / Hide Section Block provides four blocks that are used to display a group of <details> elements that each contain a <summary> and an arbitrary number of additional blocks.

  • The Show Hide Group block is a wrapping <div>.
  • The Show Hide Section block is a wrapping <details>. One or more of these blocks is added to a Show Hide Group block.
  • The Show Hide Summary block contains the content for a <summary> tag. One of these blocks is inside each Show Hide Section block.
  • The Show Hide Details block contains arbitrary content. One of these blocks is added inside each Show Hide Section block.

The HTML output for an individual section is:

<!-- Each section block has a details element. -->
<details class="wp-block-happyprime-show-hide-section">
    <!-- Each details element has a summary and additional, collapsible content. -->
    <summary class="wp-block-happyprime-show-hide-summary">Summary text</summary>
    <!-- Additional inner blocks of any type are populated here. -->
</details>

The HTML output for the group is:

<div class="wp-block-happyprime-show-hide-group">
    <!-- Optional based on attribute -->
    <button class="toggle-all" aria-expanded="false">Open all</button>
    <details class="wp-block-happyprime-show-hide-section">
        <summary class="wp-block-happyprime-show-hide-summary"></summary>
        <!-- Additional blocks to be shown/hidden -->
    </details>
    <details class="wp-block-happyprime-show-hide-section">
        <summary class="wp-block-happyprime-show-hide-summary"></summary>
        <!-- Additional blocks to be shown hidden -->
    </details>
    <!-- Additional section blocks -->
</div>

An option is provided in the block’s side panel to toggle an “Open all”/”Close all” button. If this is toggled on for a block, an additional <button> element will be inserted and JavaScript will be used on the front-end to control the show/hide behavior of all <details> elements in the group at once.

If the toggle is off, no JavaScript is loaded on the front end and only the browser’s default behavior is used for opening and closing <details> elements.

Read the full description on the official page →

Tagged as