Template:Alert/doc: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) m Update documentation to use label parameter. |
ArrowHead294 (talk | contribs) m Update documentation. |
||
| Line 8: | Line 8: | ||
* <code>text</code>: Message to be displayed in the box. | * <code>text</code>: Message to be displayed in the box. | ||
* <code>icon</code>: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box. | * <code>icon</code>: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box. | ||
: | :* <code><nowiki>{{alert}}</nowiki></code> is designed to use an {{w|emoji}} as an icon instead of an image. We recommend passing in the icon using its {{w|HTML entity}} representation (e.g. use <code>&#x1F642;</code> for 🙂</code>). | ||
* <code>label</code>: A custom label to be used, if desired. This is not used by <code><nowiki>{{note}}</nowiki></code>, <code><nowiki>{{tip}}</nowiki></code>, or <code><nowiki>{{warning}}</nowiki></code> as their labels are the same as the template names. | |||
* <code>label</code>: | |||
</ | |||
=== Types and examples === | === Types and examples === | ||
Revision as of 21:29, 3 February 2026
- This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.
| This template uses TemplateStyles: |
The Alert template is a metatemplate which is used to create alerts, also known as callouts or admonitions, to call attention to critical information. It is intended to be used in other templates for messages which are expected to be used on multiple pages.
Usage
The template accepts three parameters:
type: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section.text: Message to be displayed in the box.icon: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box.
{{alert}}is designed to use an emoji as an icon instead of an image. We recommend passing in the icon using its HTML entity representation (e.g. use🙂for 🙂).
label: A custom label to be used, if desired. This is not used by{{note}},{{tip}}, or{{warning}}as their labels are the same as the template names.
Types and examples
| Alert of note type, used by Template: Note. |
| Alert of tip type, used by Template: Tip. |
| Alert of warning type, used by Template: Warning. |