Expand Macro

This macro is available in Confluence Data Center and Confluence Cloud. Learn about the macros available in Confluence Cloud.

Add the Expand macro to your page to provide content in an expandable / collapsible section. 

This is one of Confluence's most popular macros. It's great for:

  • visually reducing the amount of information on a page
  • breaking process information down into clickable steps
  • hiding background or obsolete information, while still keeping it on the page for future reference.   

The macro is collapsed by default, people need to click each one to expand it. There's no way to expand all macros on a page at once, however all Expand macros are automatically expanded when you print or export the page to PDF.

On this page:

Screenshot: page showing four expand macros. Two are collapsed, and two are expanded. 

Add this macro to your page

To add the Expand macro to a page:

  1. From the editor toolbar, choose Insert > Other Macros.
  2. Choose Expand from the Formatting category.
  3. Enter a Title. This is the text a user will click on to show the hidden content. 
  4. Type or paste your text into the body of the macro. This content will be visible when someone clicks the macro title.
  5. Choose Insert

You can then publish your page to see the macro in action. 

Screenshot: The expand macro in the editor


Change the macro parameters

Macro parameters are used to change the behaviour of a macro.

To change the macro parameters:

  1. In the editor, click the macro placeholder and choose Edit.
  2. Update the parameters as required then choose Insert.

Here's a list of the parameters available in this macro. 

Parameter

Default

Description

Title


Click here to expand...

Defines the text that appears next to the expand/collapse icon.

Where the parameter name used in Confluence storage format or wikimarkup is different to the label used in the macro browser, it will be listed below in brackets (example).

Other ways to add this macro

Add this macro as you type

Type followed by the start of the macro name, to see a list of macros. 

Add this macro using wiki markup

This is useful when you want to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.

Macro name: expand

Macro body: Accepts rich text.

{expand}
This text is _hidden_ until you expand it.
{expand}

Notes

  • Text is expanded in PDF and HTML exports. When you export the page to PDF or HTML, the text between the macro tags is expanded so that readers can see it in the PDF and HTML versions of the page.
  • Nesting your Expand macros. You can put one Expand macro inside another, and Confluence will correctly show and hide the contents of all Expand macros, including the nested ones.
  • Using the Confluence Cloud editor? This macro may not be available in the new editor. See Expand macro for more information. 


tip/resting Created with Sketch.

Do more with Confluence

Extend Confluence with one of the hundreds of other macros in the Atlassian Marketplace, such as:

Last modified on Oct 13, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.