Template:Callout

From Cosmoteer Wiki
Jump to navigation Jump to search


Template documentation
View or edit this documentation. (About template documentation)
CalloutIconNote.pngNote
Portions of the template sample may not be visible without values provided.

Usage

Basic

{{Callout|Type|Content}}

Replace type with one of the supported types demonstrated below.

Replace content with the text you want to be displayed inside the callout.

Supported types

{{Callout|Info|This is an info Callout used to provide info and notes}}
{{Callout|Tip|This is a tip Callout used to provide tips}}
{{Callout|Warning|This is a warning Callout used to warn readers about something.}}
{{Callout|Danger|This is a danger Callout used to *really* warn readers about something.}}
{{Callout|Example|This is an example Callout used to provide examples to readers}}

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes
CalloutIconTip.png
Tip
This is a tip Callout used to provide tips
CalloutIconWarning.png
Warning
This is a warning Callout used to warn readers about something.
CalloutIconDanger.png
Danger
This is a danger Callout used to *really* warn readers about something.
CalloutIconExample.png
Example
This is an example Callout used to provide examples to readers

Changing title

The title of a callout = its type, but it can be changed:

<!--you can either provide a custom title in the 3rd parameter-->
{{Callout|Warning|This is a warning Callout used to warn readers about something.|A new cool title}}

<!--or by using a named parameter, located anywhere-->
<!--for instance, at the end -->
{{Callout|Warning|This is a warning Callout used to warn readers about something.|title=A new cool title}}
<!--or right after the type -->
{{Callout|Warning|title=A new cool title|This is a warning Callout used to warn readers about something.}}

<!--you can either provide a custom title in the 3rd parameter-->

CalloutIconWarning.png
A new cool title
This is a warning Callout used to warn readers about something.

<!--or by using a named parameter, located anywhere-->

<!--for instance, at the end -->

CalloutIconWarning.png
A new cool title
This is a warning Callout used to warn readers about something.

<!--or right after the type -->

CalloutIconWarning.png
A new cool title
This is a warning Callout used to warn readers about something.

Aligning horizontally

A callout can be aligned horizontally. It's aligned to the left by default.

Note: The borders are added for clarity, they are not present in the template.

{{Callout|align=left|Info|This is an info Callout used to provide info and notes}}
{{Callout|align=center|Info|This is an info Callout used to provide info and notes}}
{{Callout|align=right|Info|This is an info Callout used to provide info and notes}}

Text before callout.

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes

Text after callout.

Text before callout.

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes

Text after callout.

Text before callout.

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes

Text after callout.

Floating

Floating allows text and other content around the callout to wrap around it, making for a more compact content arrangement.

{{Callout|float=left|Info|This is an info Callout used to provide info and notes}}
{{Callout|float=right|Info|This is an info Callout used to provide info and notes}}

<!-- stacked together -->
{{Callout|float=right|Info|This is an info Callout used to provide info and notes}}
{{Callout|float=right|Info|This is an info Callout used to provide info and notes}}

Text before callout.

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes

Text after callout.

Text before callout.

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes

Text after callout

<!-- stacked together -->

Text before callout.

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes
CalloutIconNote.png
Info
This is an info Callout used to provide info and notes

Text after callout

A more compact version

A callout has a compact variant that may be preferable in some cases, e.g. to not to overbloat the page.

{{Callout|compact=1|Info|This is an info Callout used to provide info and notes}}

CalloutIconNote.pngInfo
This is an info Callout used to provide info and notes
CalloutIconTip.pngTip
This is a tip Callout used to provide tips
CalloutIconWarning.pngWarning
This is a warning Callout used to warn readers about something.
CalloutIconDanger.pngDanger
This is a danger Callout used to *really* warn readers about something.
CalloutIconExample.pngExample
This is an example Callout used to provide examples to readers

Adding spacing to the bottom

An additional spacing can be added to the bottom of the callout to separate it from the rest of the content.
This is mainly used on callouts that appear at the start of a page as notices, e.g. {{Stub}} or {{WorkInProgress}}.

{{Callout|bottom margin=2rem|Info|This is an info Callout used to provide info and notes}}

CalloutIconNote.png
Info
This is an info Callout used to provide info and notes

Text on a next line.

Usage within differing formatting

In a list

Warning: using the {{br}} template here to add newlines will break the template — use <br> tag directly instead.

  • Apples
    CalloutIconTip.png
    Tip
    Apples are tasty, but try bananas also!

    Do not be afraid 👁️👁️
  • Bananas

With line breaks

using {{br}} template:

CalloutIconTip.png
Tip
Line1


Line2
CalloutIconTip.pngTip
Line1


Line2

A template used to insert colourful callouts into articles.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Typetype 1

Type of callout. Lowercase values are allowed.

Suggested values
Info Tip Warning Danger Example
Linerequired
Callout Contenttext 2

Content that will be shown in the callout.

Example
This is a callout comment
Contentrequired
Title Overridetitle 3

Override the callout's title, e.g. change 'Info' to a custom value.

Example
My Title
Lineoptional
Compactcompact

Whether to use the compact version of a callout. Disabled by default. Set to 1 to enable.

Auto value
0
Booleansuggested
Alignalign

Horizontal alight of the callout. Lowercase values are allowed.

Suggested values
Left Center Right
Default
left
Lineoptional
Floatfloat

Makes the callout float. Automatically adds clear property to the same side, allowing for stacking multiple floating callouts on the same side.

Suggested values
none left right inline-start inline-end
Auto value
none
Stringsuggested
Additional bottom marginbottom margin

Allows to add additional spacing below the Callout. Any valid CSS-length is supported (see more: https://developer.mozilla.org/en-US/docs/Web/CSS/length).

Default
0
Example
1rem, 15px
Auto value
1rem
Stringoptional