Template:Expand
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.
Usage
Wraps content in a box that can dynamically be expanded or collapsed.
![Icon-Important.png](/w/images/thumb/5/5c/Icon-Important.png/10px-Icon-Important.png)
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.
The above documentation is transcluded from Template:Expand/doc. (Edit | Page history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.