Collapses the block with an expand button.
Collapsible Code
1 min readStableIntermediate
Long code blocks can overwhelm a page. The expandable metastring collapses the block to a configurable number of visible lines with an expand button.
Quick Start
Collapse a block with expandable.
JSON
JSON
Adding Options
Cap the visible lines with maxLines=N.
JSON
JSON
Advanced
Combine expandable, maxLines, and a file title to collapse a large config file.
tsconfig.json
JSON
Options
expandablebooleanDefault: falsemaxLines=NnumberNumber of lines visible before expansion. When omitted, the block collapses to a fixed 15em height.
Related pages
Was this page helpful?