npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fdevbr/docusaurus-plugin-panzoom

v1.0.2

Published

A plugin to enable the panzoom component on SVG and other elements

Readme

docusaurus-plugin-panzoom

This plugin adds the ability to pan and zoom images and SVG images inside of a Docusaurus website. This is useful for embedding diagrams or complex mermaid.js renders around models and object schemas. The normal theme doesn't scale tremendously well in a browser so some augmentation for complex diagrams is necessary.

This implements the excellent @panzoom/panzoom plugin.

Installation

npm install @fdevbr/docusaurus-plugin-panzoom
// In docusaurus.config.js
// ...
plugins: ['@fdevbr/docusaurus-plugin-panzoom'],
// or
plugins: [['@fdevbr/docusaurus-plugin-panzoom', {} /* options */]],

Configuration

The plugin accepts the following configuration options:

// In docusaurus.config.js
// ...
themeConfig: {
  zoom: {
    // A list of selectors to look for elements to enable pan and zoom
    // Default: ['div.mermaid[data-processed="true"]', 'div.docusaurus-mermaid-container', '.drawio']
    selectors: ['div.mermaid[data-processed="true"]', '.drawio'],

    // Whether to wrap the panzoom items in a div with overflow:hidden
    // This constrains the pan zoom detail into the original container
    // Default: true
    wrap: true,

    // The amount of time to wait in MS before the plugin client module tries to look for
    // and alter pan zoom elements. Some renders take a little bit before they appear in the dom.
    // Default: 1000
    timeout: 1000,

    // Add this class to any element within the Panzoom element that you want to exclude from
    // Panzoom handling. That element's children will also be excluded.
    // Default: 'panzoom-exclude'
    excludeClass: 'panzoom-exclude',

    // Whether to enable zooming with the mouse wheel.
    // Default: true
    enableWheelZoom: true,

    // Whether to enable zooming with the mouse wheel while holding the shift key.
    // Works independently of enableWheelZoom.
    // Default: false
    enableWheelZoomWithShift: false,

    // Whether to enable double-click to reset zoom.
    // Default: true
    enableDoubleClickResetZoom: true,

    // Whether to restrict zooming out beyond the original size of the element.
    // Default: false
    restrictZoomOutBeyondOrigin: false,

    // Toolbar options: shows zoom in, zoom out, and reset buttons.
    toolbar: {
      // Whether to show the toolbar.
      // Default: false
      enabled: false,

      // Toolbar position: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
      // Default: 'top-right'
      position: 'top-right',

      // Toolbar opacity when not hovered (0 to 1). Becomes fully opaque on hover.
      // Default: 0
      opacity: 0,
    },

    // Expand feature: adds an expand button to the toolbar that hides the sidebar, TOC,
    // navbar, and site footer, expanding the diagram to near-full-width.
    // Requires toolbar.enabled: true
    expand: {
      // Whether to show the expand button in the toolbar.
      // Default: false
      enabled: false,
    },

    // You can also pass any options supported by @panzoom/panzoom
    // See: https://github.com/timmywil/panzoom for available options
  }
}

Expand Feature

This fork adds an in-page expand mode: when expand.enabled is set to true, an expand button appears in the toolbar. Clicking it (or pressing Escape to exit) triggers the following behaviour:

On expand:

  • Hides the sidebar, table-of-contents column, navbar, and site footer
  • Stretches the main content area to near-full-width
  • Scrolls to the top of the page so the diagram is immediately visible
  • The toolbar buttons become position: fixed so they stay on screen while panning/zooming

On collapse:

  • Restores all hidden elements
  • Smoothly scrolls back to the diagram so you don't lose your place
  • The toolbar expand button icon resets correctly (including when closed via Escape)
themeConfig: {
  zoom: {
    toolbar: { enabled: true },
    expand: { enabled: true },
  }
}

[!NOTE] This package is a fork of @r74tech/docusaurus-plugin-panzoom, which itself is a fork of act-org/docusaurus-plugin-panzoom, under the MIT license.

Changes introduced in this fork (@fdevbr):

  • In-page expand mode: adds an expand button that hides the sidebar, TOC, navbar, and site footer and expands the diagram to near-full-width inline, without opening a dialog.
  • Fixed toolbar in expand mode: toolbar buttons stay pinned to the viewport corner while panning.
  • Scroll to top on expand: the page scrolls to the top when expand mode is activated.
  • Scroll back on collapse: the page scrolls back to the diagram when expand mode is exited.

If you don't need the expand feature, consider using @r74tech/docusaurus-plugin-panzoom directly.

License

MIT, see LICENSE for more details.