Jump to content

Template:Banner

From Swarthmore Knowledge Base


A coloured callout box for notes, success messages, warnings, and errors. Colours follow the wiki's light and dark themes automatically.

Usage

Basic examples

{{Banner|This is an informational note.}}
{{Banner|type=success|title=Saved|Your changes have been published.}}
{{Banner|type=warning|title=Heads up|This page describes a beta feature.}}
{{Banner|type=danger|title=Warning|This action will delete your data.}}


This is an informational note.

Saved

Your changes have been published.

Heads up

This page describes a beta feature.

Warning

This action will delete your data.

Alternative parameters

The variant parameter is an alias for type, and content is an alias for the unnamed message parameter.

{{Banner|variant=success|Operation completed.}}
{{Banner|content=This is the message.}}


Operation completed.

This is the message.

Custom icons

Specify an icon from Template:Icon, or use icon=none to hide the icon.

{{Banner|icon=lightbulb|title=Tip|Try this approach.}}
{{Banner|icon=none|A banner without an icon.}}


Tip

Try this approach.

A banner without an icon.

Content containing equals signs

If the message contains an equals sign, use 1= or content=.

{{Banner|1=Use x=5 in your configuration.}}
{{Banner|content=Use x=5 in your configuration.}}

Parameters

Displays a themed callout banner for notes, success messages, warnings, and errors.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Message1 content

The main text of the banner. Supports wikitext, including links and formatting. Use 1= if the message contains an equals sign.

Example
Your changes have been saved.
Contentsuggested
Banner typetype variant

Controls the colour and default icon of the banner. The value 'error' is also accepted as an alternative to 'danger'.

Suggested values
info success warning danger
Default
info
Stringsuggested
Titletitle

Optional bold heading displayed above the message.

Example
Important
Stringsuggested
Iconicon

Optional icon name supported by Template:Icon. Use 'none' to hide the icon. If omitted or empty, the icon is selected automatically based on the banner type.

Example
lightbulb
Stringoptional

Notes

  • If both type and variant are provided, a nonempty type takes precedence.
  • If both content and 1 are provided, content takes precedence.
  • Unknown banner types use the informational appearance.
  • Omitting icon, or setting it to an empty value, uses the default icon for the selected type.
  • Setting icon=none hides the icon.
  • Icons are decorative and hidden from screen readers. Important information should be conveyed in the banner text.