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.
| This is a documentation subpage for Template:Clickable button. It may contain usage information, categories and other content that is not part of the original template page. |
| This template should never be substituted – use {{Clickable button}}. |
| This template is used in system messages, and on approximately 1,870,000 pages, or roughly 3% 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 uses Lua: |
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.
{{Clickable button|wikilink|display|color=color|url=url|class=class|link=}}|color= or |class=|color= accepts blue and red, |class= accepts mw-ui-progressive and mw-ui-destructive|url=|link=no{{Clickable button|Main Page}} → {{Clickable button|Main Page|Click here to visit the main page}} → {{Clickable button|Click here|link=no}} → {{Clickable button|Main Page}} → – without defined |color= and |class=, the default is a white button{{Clickable button|Main Page|color=blue}} → {{Clickable button|Main Page|color=red}} → {{Clickable button|Main Page|class=mw-ui-progressive}} → {{Clickable button|Main Page|class=mw-ui-destructive}} → {{Clickable button|url=https://example.com}} → {{Clickable button|Example|url=https://example.com}} → {{Clickable button|2=Example|url=https://example.com}} → Adding an icon to a button should be avoided. Don't forget to hide the icon from the accessibility DOM by wrapping it in a span that is aria-hidden="true" so that a screen reader doesn't read it out loud.
<span class="mw-ui-button mw-ui-progressive"><span aria-hidden="true">[[File:OOjs UI icon logo-wikimediaCommons-invert.svg|15px|link=|alt=]]</span> More details</span>
Styles a link like a button, using the mediawiki.ui.button module
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Link/Label | 1 | Defines the page to link to, and uses that page's title as the text for the button
| Page name | required |
| Label | 2 | Defines the text that appears on the button
| Unknown | suggested |
| URL | url | Defines a web address for the button to link to
| URL | optional |
| class | class | Defines the visual type of the button
| String | optional |
| Custom CSS styling | style | Allows custom CSS styling to be applied to the button
| String | optional |
| Category switch | category | Whether or not categories should be on
| Boolean | optional |
| color | color | Defines the visual type of the button
| String | optional |
mw-ui-constructive, the CSS class for green buttonsInformasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.