expressive-code-collapsible
v0.1.0
Published
An Expressive Code plugin to expand or collapse code blocks.
Maintainers
Readme
Features
- Long code blocks automatically collapse based on a configurable line threshold
- Force collapse or expand on any block using
collapseornocollapsemeta strings - Toggle buttons appear both as an overlay and in the header (when a title is present)
- Animated transitions that respect
prefers-reduced-motion - Accessible with ARIA attributes and customizable screen reader announcements
- Works with Starlight, Astro, Next.js, and standalone Expressive Code setups
Installation
Install the plugin using your preferred package manager:
npm install expressive-code-collapsibleQuick Start
import { pluginCollapsible } from 'expressive-code-collapsible';
// Add to your Expressive Code configuration
plugins: [pluginCollapsible()]Documentation
For comprehensive documentation, installation guides, configuration options, and examples, visit the plugin documentation.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
Licensed under the MIT License, Copyright © frostybee.
See LICENSE for more information.
