Jump to content
Toggle menu
  • 12,3 E szócikkek
  • 21,5 E fájlok
  • 4 felhasználók
  • 63,9 E szerkesztések
SCWIKI
Toggle preferences menu
Toggle personal menu
Nem vagy bejelentkezve
Your IP address will be publicly visible if you make any edits.

Renders an inline icon and text pair: a small icon followed by a plain text label, neither of which links anywhere. The icon is inert decoration and the label is plain text. Suited to compact inline metadata such as a clock beside a duration, a map pin beside a location, or a status glyph beside a label. Wraps Module:IconText; see the module page for rendering details. For an icon and label that both link to a page, use Template:IconLink.

Usage

The first positional argument is the text label; icon is the file name of the leading glyph. size sets the icon size; class appends a CSS class to the root span.

Wikitext Result
{{IconText|5 minutes|icon=CdxIconClock.svg}} 5 minutes
{{IconText|Stanton|icon=CdxIconMapPin.svg}} Stanton
{{IconText|Warning|icon=CdxIconError.svg|size=16px}} Warning
{{IconText|5 minutes|icon=CdxIconClock.svg|mask=yes}} 5 minutes

Parameters

Renders an inline icon and text pair: a small icon followed by a plain text label, neither of which links anywhere. The icon is inert decoration and the label is plain text. Suited to compact inline metadata such as a clock beside a duration, a map pin beside a location, or a status glyph beside a label. Wraps Module:IconText; see the module page for rendering details. For an icon and label that both link to a page, use Template:IconLink.

Sablonparaméterek

Ennek a sablonnak ajánlott egy sorba írni a paramétereit.

ParaméterLeírásTípusÁllapot
Text1 text

Visible text label. Alias: `text` (takes precedence over the positional argument).

Példa
5 minutes
Karakterlánckötelező
Iconicon

File name (without the `File:` prefix) of the leading icon.

Példa
CdxIconClock.svg
Fájlkötelező
Icon tooltipiconTitle

Tooltip shown when hovering the icon; also sets the icon's alt text.

Példa
Estimated time
Karakterláncnem kötelező
Icon sizesize

Icon size, as a MediaWiki image size.

Alap­értelmezett
20px
Példa
16px
Karakterláncnem kötelező
Mask iconmask

Render the icon as a recolorable CSS mask filled with the current text color, instead of an image.

Alap­értelmezett
false
Példa
yes
Logikainem kötelező
CSS classclass

Extra class appended to the root span.

Példa
my-icon-text
Karakterláncnem kötelező

Behavior

  • The icon and the text sit in a single inline-flex span, so they stay on one line with a small gap and align vertically centered.
  • The icon is rendered with an empty link= and class=metadata, so it is not clickable and is excluded from MultimediaViewer — it reads as inert decoration.
  • iconTitle, when supplied, becomes the icon's hover tooltip (the title attribute) and its alt text; without it the icon has no tooltip.
  • mask swaps the <img> for a CSS mask filled with background-color: currentColor, so the icon takes on the surrounding text color and recolors with it. Provide a single-color (for example Codex) icon for the best result.
  • text is an accepted alias for the first positional argument. If both are supplied, text takes precedence.
  • If icon or the text is omitted, the module raises a script error.

See also