Template:Expand/doc
Jump to navigation
Jump to search
Important:Do not use this template in the middle of a line. Start a new line, which also allows you to indent it using colons.

This is a documentation subpage for Template:Expand.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Usage
Wraps content in a box that can dynamically be expanded or collapsed.

Text {{Expand|margin_left=2em|Text}} Text <!-- breaks -->
Text
:{{Expand|Text}} <!-- good! -->
Text
Parameters
- {{{1}}} – The content to expand or hide.
- {{{float}}} – Set to
left
orright
if floating is desired. Using this parameter is preferable to addingstyle=float:right
because this also adjusts the title alignment appropriately, see the example below. - {{{title}}} – An optional title shown next to the expand button.
- {{{titlestyle}}} – Adds extra title style parameters.
- {{{noborder}}} – If non-zero, use no surrounding border.
Warning:It can become difficult to tell where the expanded text ends if the background colors are identical! Use this only if you would end up with double borders for example.
- {{{startcollapsed}}} – If set to 0, the content will initially be visible, otherwise collapsed. Default is 1.
- {{{color}}} – The color of the left border and title, if used.
- {{{bgcolor|rgba(0,0,0,0.05)}}} – The background color of the content. This defaults to
transparent
if {{{noborder}}} is not 0. - {{{margin_bottom|1em}}} – The border on the bottom.
- {{{margin_left|0}}} – The border on the left.
- {{{style}}} – Adds style parameters for the table that this template is based on.
Examples
{{expand|{{KV Breakable}}}}
renders as follows.
{{expand|{{KV Breakable}}|noborder=1}}
renders as follows.
{{expand|color=yellow|title=Yellow|Yellow!}}
renders as follows.
:{{expand|Can be indented.}}
renders as follows.
{{expand |title=float{{=}}right |float=right | The title alignment also uses {{param|float}} so that the button stays at the same position when toggling. }}
See how this renders on the right.