--- id: sphinx-togglebutton version: "0.4.5" license: MIT License license_treatment: permissive maintenance: active --- # sphinx-togglebutton — Toggle page content and collapse admonitions in Sphinx. License: permissive · Maintenance: active · Downloads: 519.4K/mo ## What it is and what it does sphinx-togglebutton is a Sphinx extension that adds interactive collapse/expand functionality to your documentation. It lets you hide admonitions (notes, warnings, etc.) behind toggle buttons so readers only see content when they click, and also provides a generic container directive for collapsing arbitrary sections. The extension supports showing content expanded or collapsed by default via CSS classes, and includes internationalization for toggle button labels across many languages. You install it by adding it to your Sphinx conf.py extensions list, then mark admonitions with the `dropdown` class or use container directives with toggle classes. It requires sphinx and docutils as runtime dependencies and has no compiled components, making it straightforward to install and use in any Sphinx-based documentation workflow. Use it for: - Hide verbose admonitions (warnings, notes) in documentation to reduce visual clutter while keeping them accessible - Collapse code examples or implementation details that readers may not need on first read - Create expandable FAQ or troubleshooting sections where each answer starts hidden - Organize long documentation pages by collapsing optional or advanced content sections ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Sphinx extension that adds collapsible toggle buttons to admonitions and arbitrary content sections, allowing documentation authors to hide and show content on demand. Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT License, and solves a common documentation UX problem with low install friction. It's a lightweight, focused extension that integrates cleanly into Sphinx workflows. ## Install pip install sphinx-togglebutton uv add sphinx-togglebutton poetry add sphinx-togglebutton ## Installing sphinx-togglebutton Before you install: Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release and no known vulnerabilities. Depends on standard Sphinx ecosystem packages. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial documentation projects. Quickstart: pip install sphinx-togglebutton Then in conf.py: extensions = ['sphinx_togglebutton'] In your .rst file: .. note:: :class: dropdown This is my note. Verify before relying: - Whether the extension works with all current Sphinx versions or has specific version constraints - Performance impact when toggling large numbers of collapsed sections ## Package facts - License: MIT License (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 519.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sphinx collapsible admonitions, sphinx toggle button extension, hide show sphinx content, sphinx dropdown sections, sphinx collapsible documentation, sphinx-extension, documentation-ux [View on SkillFed](https://skillfed.io/packages/sphinx-togglebutton) · [View on PyPI](https://pypi.org/project/sphinx-togglebutton/)