Select one or more tags, then press “Search Plugins”

Find Plugin with any / all of the selected criteria
Search Plugin

DK Table Of Contents Preview Toggle Wordpress Plugin - Rating, Reviews, Demo & Download

DK Table Of Contents Preview Toggle Preview Wordpress Plugin - Rating, Reviews, Demo & Download
No ratings yet
Free
Follow for free plugins, new theme releases and theme news

Plugin Description

This plugin is not affiliated with, endorsed by, or sponsored by Rank Math. Rank Math is a trademark of its respective owner.

Works with Rank Math’s Table of Contents block. DK Table of Contents Preview Toggle is an independent add-on for the Table of Contents block in the free Rank Math SEO plugin. Long tables of contents push your article below the fold, especially on phones. This plugin shows a short preview of the list instead, with a soft fade at the bottom, and turns the block’s title into a button that expands and collapses the full list. On a touch screen, the first tap on that preview opens the full list instead of jumping to a heading. The next tap on a heading goes there.

It was built for Core Web Vitals first:

  • No layout shift. The list is already collapsed when the page first paints, using a few lines of inline CSS. Nothing jumps when scripts load, and there is no hover expansion. Measured Cumulative Layout Shift from the plugin is 0 on load and on toggle.
  • Fast interactions. A few delegated listeners (about 10 KB with comments, about 3 KB minified) flip a class and aria-expanded. They never measure the page when someone taps or clicks, so they add next to nothing to Interaction to Next Paint.
  • No effect on Largest Contentful Paint. No web fonts, images or extra requests beyond one small deferred script.
  • Loads only where it is used. Pages without the Table of Contents block get no CSS and no JavaScript from this plugin.

It is accessible:

  • The title becomes a real <button> with aria-expanded and aria-controls, so it works with a mouse, a tap, and the Enter and Space keys, and screen readers announce its state.
  • The entries stay links to your headings. With a mouse, a click goes straight to the heading. On a touch screen, the first tap anywhere on a collapsed list opens it, including a tap on a heading, and the next tap follows the heading.
  • Keyboard users who tab into the list see the whole list, even before the script loads.
  • If JavaScript is turned off, the full list is shown.
  • Respects “reduce motion”.

It works with caching and optimization plugins, including NitroPack, WP Rocket, LiteSpeed Cache, W3 Total Cache, Autoptimize, Perfmatters, FlyingPress, SiteGround Speed Optimizer, and Cloudflare APO and Rocket Loader. See the FAQ for details.

How it works

Add the Table of Contents block from Rank Math to a post or page as usual. When the list has four or more entries and a visible title, this plugin:

  1. Adds the dknm-ctoc class to the block and an ID to its list.
  2. Wraps the title in a toggle button.
  3. Prints a small inline style that limits the list to a 120px preview with a fade.
  4. Loads a small deferred script that opens and closes the list. On a touch screen, the first tap on a collapsed list opens it.

Lists with fewer than four entries, and blocks without a title, are left exactly as Rank Math renders them. AMP pages, feeds and embeds always get the full, open list.

There is no settings screen. Developers can change the behavior with filters (see the FAQ).

Privacy

This plugin makes no external requests, sets no cookies, collects no data and does no tracking. It stores nothing except a per-user flag when an administrator dismisses its “Rank Math is not active” notice, and it removes that flag when the plugin is deleted.

Built by DK New Media. Visit Martech Zone for updates on this plugin and other marketing tools.

Screenshots

  1. A long table of contents collapsed to a short preview with a fade, on a phone.

    A long table of contents collapsed to a short preview with a fade, on a phone.

  2. The same list expanded after tapping the title. The arrow flips and the button reports aria-expanded="true".

    The same list expanded after tapping the title. The arrow flips and the button reports aria-expanded=”true”.

  3. On desktop, collapsed and expanded side by side.

    On desktop, collapsed and expanded side by side.

  4. The notice shown when Rank Math or its Table of Contents block is not available.

    The notice shown when Rank Math or its Table of Contents block is not available.


Reviews & Comments