Template:Collapse
Collapse |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
This template, {{Collapse}}
, creates a collapsible container for page content that would benefit from an (optional) ability to be hidden from view, with the ability to appear in either the collapsed or expanded state by default.
Usage
In its simplest functional use case, the template's invocation need only include the parameters for the container's title and contents, taking the form:
{{Collapse|title=Box title|content=The contents of the box…}}
Blank example blocks
With common parameters only
Below is an example of the template formatted as a block with the most commonly used parameters, plus guidance on valid values where applicable; please delete all unused parameters before saving if copied and pasted.
{{Collapse
| title =
| expand = <!-- 'no' to default to collapsed state, otherwise leave unset -->
| background-c =
| align =
| padding =
| content = <!-- Box content goes here -->
}}
With all parameters
Below is an example of the template formatted as a block with all possible named parameters, plus guidance on valid values where applicable; please delete all unused parameters before saving if copied and pasted.
{{Collapse
| title =
| expand = <!-- 'no' to default to collapsed state, otherwise leave unset -->
| background-c =
| color =
| font-size =
| align =
| padding =
| width =
| margin =
| clear = <!-- [ none | left | right ] -->
| border-w = <!-- [ thin | medium | thick ] or absolute length -->
| border-s = <!-- [ none | hidden | dotted | dashed | double | groove | ridge | inset | outset ] -->
| border-c =
| header-align = <!-- [ start | end | left | right | justify | match-parent | justify-all ] -->
| header-c =
| header-bw = <!-- [ thin | medium | thick ] or absolute length -->
| header-bs = <!-- [ none | hidden | dotted | dashed | double | groove | ridge | inset | outset ] -->
| header-bc =
| header-fc =
| header-fs =
| header-fw = <!-- [ 100 | 200 | 300 | normal | 500 | 600 | bold | 800 | 900 ] -->
| header-p =
| class =
| style =
| content = <!-- Box content goes here -->
}}
TemplateData
This is the TemplateData documentation for this template used by VisualEditor and other tools.
Collapse
Places page content that consumes excess vertical space or is likely to interest only a subset of readers within a collapsible box that can appear in either state by default, keeping it in place and accessible without detriment to the overall layout or readability
Parameter | Description | Type | Status | |
---|---|---|---|---|
Title | title 2 | The heading which describes the box's contents and is the only thing shown when in the collapsed state
| Line | required |
Content | content 1 | The page content to appear within the collapsible box
| Content | required |
Default expansion state | expand | When assigned the value 'no', the container's default appearance becomes its collapsed state
| Boolean | optional |
Title background color | header-c | Background color of the box title's rectangular element, must be a valid CSS color value (named, hexadecimal code, RGB decimals, etc.)
| Line | optional |
Background color | background-c | The background color for the box's contents, which also narrowly surrounds the title in the collapsed state; must be a valid CSS color value (named, hexadecimal code, RGB decimals, etc.).
| Line | optional |
Title text color | header-fc | Font text color of the box's title, must be a valid CSS color value (named, hexadecimal code, RGB decimals, etc.)
| Line | optional |
Text color | color | Font text color of the box's content and, optionally, its title; must be a valid CSS color value (named, hexadecimal code, RGB decimals, etc.).
| Line | optional |
Title font weight | header-fw | Sets the thickness of the title text font, must be an unsigned (positive) integer between 100 and 900, inclusive, or a relative CSS font-weight keyword
| Line | optional |
Title text size | header-fs | Size of the box's title text font, must be a valid CSS length value with unit suffix or a relative size keyword
| Line | optional |
Text size | font-size | Font size of the text content contained within the box, must be a valid CSS length value with unit suffix or a relative size keyword
| Line | optional |
Title alignment | header-align | Sets the horizontal alignment of the box's title within its rectangular element
| Line | optional |
Content alignment | align | Sets the horizontal alignment of the box's contents
| Line | optional |
Title padding | header-p | Sets the padding of the box title's rectangular element, or the distance from which it extends in all four directions beyond the title text; must be composed of 1–4 valid CSS length value(s) with unit suffix(es)
| Line | optional |
Content padding | padding | Defines the thickness of the null space between the box's contents and its borders, must be composed of 1–4 valid CSS length value(s) with unit suffix(es)
| Line | optional |
Width | width | The width of the collapsible box, either as an exact CSS length value with unit suffix or relative percentage of the page or viewport
| Line | optional |
Margin width | margin | Defines the size of the collapsible box's margins from other elements on the page, must consist of 1–4 valid CSS length values with unit suffix
| Line | optional |
Float clearance | clear | Forces box to move below any floating elements on either or both page margins that prevent it from extending there
| Line | optional |
Title border width | header-bw | Thickness of the box title rectangular element's border, must be a valid CSS length value with unit suffix or one of: 'thin', 'medium' or 'thick'
| Line | optional |
Border width | border-w | Thickness of the box's outer border, must be a valid CSS length value with unit suffix or one of: 'thin', 'medium' or 'thick'
| Line | optional |
Title border style | header-bs | Style of the box title rectangular element's border
| Line | optional |
Border style | border-s | Style of the box's outer border
| Line | optional |
Title border color | header-bc | Color of the box title rectangular elements's outer border, must be a valid CSS color value (named, hexadecimal code, RGB decimals, etc.)
| Line | optional |
Border color | border-c | Color of the box's outer border, must be a valid CSS color value (named, hexadecimal code, RGB decimals, etc.)
| Line | optional |
Extra CSS classes | class | Adds additional class names to the top-level 'div' HTML container element
| Line | optional |
Extra CSS style declarations | style | Defines additional CSS style declarations to be added to the collapsible container's outer table element, multiple declarations must be semicolon-delimited
| String | optional |
See also
- {{Hidden}} – functionally very similar, but with different aesthetics
- {{Hidden archive top}} (and {{Hidden archive bottom}}) – also similar in function, but meant specifically for pages in Talk namespaces with an included admonition not to disturb the contents in the interests of maintaining a faithful archive of past events
These template pairs also produce a similar content container, but are more compatible with complex wiki markup structures:
- {{Collapse top}} (and {{Collapse bottom}})
- {{Hidden begin}} (and {{Hidden end}}) Category:Formatting templates