• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Clickable button/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Clickable button
This is the template sandbox page for Template:Clickable button (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Clickable button (sandbox)
Shortcuts
  • {{CLBTemplate:CLB}}
  • {{clickbTemplate:Clickb}}
  • {{ClickTemplate:Click}}
WarningThis template is used in system messages, and on approximately 1,100,000 pages, or roughly 2% of all pages.
Changes to it can cause immediate changes to the Wikipedia user interface.
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them.
Buttons should not be used in the article namespace. If the desire is to "navigate" a reader to a new page, taking them away from the current page, a link is preferred. Buttons are used within Wikipedia to trigger an "action".

This template styles a link like a button, using the deprecated mediawiki.ui.button module. This expands the clickable area and tap target for the link.

Contents

  • 1 Usage
  • 2 Examples
    • 2.1 Wikilinks
    • 2.2 Colors
    • 2.3 URLs
    • 2.4 Adding an icon
  • 3 Template data
  • 4 See also

Usage

edit
All parameters
{{Clickable button|wikilink|display|color=color|url=url|class=class|link=}}
wikilink
Unnamed first parameter; the title of the page being linked. Brackets are not necessary
display (optional)
Optional unnamed second parameter; the text to display. Not needed if the text to display is the wikilink itself
|color= or |class=
Color to display. |color= accepts blue and red, |class= accepts mw-ui-progressive and mw-ui-destructive
|url=
URL to link through the button. If no wikilink/display text is provided, will show the URL, otherwise will show the wikilink/display text
|link=no
Use this parameter set to "no" to display a button without linking to anything

Examples

edit

Wikilinks

edit
{{Clickable button|Main Page}} → Main Page
{{Clickable button|Main Page|Click here to visit the main page}} → Click here to visit the main page
{{Clickable button|Click here|link=no}} → Click here

Colors

edit
{{Clickable button|Main Page}} → Main Page – without defined |color= and |class=, the default is a white button
{{Clickable button|Main Page|color=blue}} → Main Page
{{Clickable button|Main Page|color=red}} → Main Page
{{Clickable button|Main Page|class=mw-ui-progressive}} → Main Page
{{Clickable button|Main Page|class=mw-ui-destructive}} → Main Page

URLs

edit
{{Clickable button|url=https://example.com}} → https://example.com
{{Clickable button|Example|url=https://example.com}} → Example
{{Clickable button|2=Example|url=https://example.com}} → Example

Adding an icon

edit

Adding an icon to a button should be avoided.

<span class="mw-ui-button mw-ui-progressive">[[File:OOjs UI icon logo-wikimediaCommons-invert.svg|15px|link=|alt=]]&nbsp;{{int:multimediaviewer-repository-local}}</span>

 More details

Template data

edit

Styles a link like a button, using the mediawiki.ui.button module

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Link/Label1

Defines the page to link to, and uses that page's title as the text for the button

Example
Foobar
Page namerequired
Label2

Defines the text that appears on the button

Default
the page being linked to
Unknownsuggested
URLurl

Defines a web address for the button to link to

Example
https://www.example.com
URLoptional
classclass

Defines the visual type of the button

Suggested values
mw-ui-progressive mw-ui-destructive
Stringoptional
Custom CSS stylingstyle

Allows custom CSS styling to be applied to the button

Default
None
Example
border: 2px solid red;
Stringoptional
Category switchcategory

Whether or not categories should be on

Default
yes
Example
no
Auto value
0
Booleanoptional
colorcolor

Defines the visual type of the button

Suggested values
blue red
Stringoptional

See also

edit
  • commons:Template:Clickable button, corresponding clickable button at Commons.
  • Wikimedia design style guide advice on buttons
  • phab:T146923, which dropped support for mw-ui-constructive, the CSS class for green buttons
  • v
  • t
  • e
Button templates
General button templates
  • {{Clickable button}}
  • {{Branded button}}
  • {{Button}} (not clickable)
  • {{Blue button}}
  • {{MediaWiki button}}
WikiProject-specific buttons
  • Article Wizard
    • button
    • button2
    • button wizard
  • {{Big Blue Button}}
  • {{Big Red Button}}
  • {{Big Cyan Button}}
  • {{Big Green Button}}
  • {{Big Lime Button}}
  • {{Big Orange Button}}
  • {{Big Turquoise Button}}
  • {{Big Fuchsia Button}}
  • {{Big Skyblue Button}}
  • {{Big Purple Button}}
  • {{Big Yellow Button}}
  • {{AfC button}}
  • {{Cleanup Button}}
  • Category
The above documentation is transcluded from Template:Clickable button/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Clickable_button/sandbox&oldid=1290851811"
Last edited on 17 May 2025, at 13:58

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 17 May 2025, at 13:58 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop