قالب:Clickable button/doc

تحذير 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.

Usage

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

Wikilinks

{{Clickable button|Main Page}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".
{{Clickable button|Main Page|Click here to visit the main page}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".
{{Clickable button|Click here|link=no}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".

Colors

{{Clickable button|Main Page}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button". – without defined |color= and |class=, the default is a white button
{{Clickable button|Main Page|color=blue}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".
{{Clickable button|Main Page|color=red}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".
{{Clickable button|Main Page|class=mw-ui-progressive}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".
{{Clickable button|Main Page|class=mw-ui-destructive}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".

URLs

{{Clickable button|url=https://example.com}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".
{{Clickable button|Example|url=https://example.com}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".
{{Clickable button|2=Example|url=https://example.com}}خطأ: لا توجد وحدة بهذا الاسم "Clickable button".

Adding an icon

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>&nbsp;More details</span>

ملف:OOjs UI icon logo-wikimediaCommons-invert.svg More details

Template data

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

وسائط القالب

هذا القالب يفضل التنسيق بنفس السطر للوسائط.

وسيطوصفنوعحالة
Link/Label1

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

مثال
Foobar
اسم الصفحةمطلوب
Label2

Defines the text that appears on the button

غيابي
the page being linked to
غير معروفمقترح
URLurl

Defines a web address for the button to link to

مثال
https://www.example.com
مساراختياري
classclass

Defines the visual type of the button

القيم المقترحة
mw-ui-progressive mw-ui-destructive
نصاختياري
Custom CSS stylingstyle

Allows custom CSS styling to be applied to the button

غيابي
None
مثال
border: 2px solid red;
نصاختياري
Category switchcategory

Whether or not categories should be on

غيابي
yes
مثال
no
قيمة تلقائية
0
بوليانياختياري
colorcolor

Defines the visual type of the button

القيم المقترحة
blue red
نصاختياري

See also