Jump to content

Template:Button

From Creopedia

This documentation is transcluded from Template:Button/doc.

This template renders a generic button component. It is commonly used by other templates and modules.

Usage

Target

Must contains either the page or url parameter.

Internal link {{Button|label=Label|link=Main Page}} Label
External link {{Button|label=Label|url=https://example.com}} Label

Action & Weight

{{Button|label=<label>|link=<wikipage>|action=<action>|weight=<weight>}}

Normal Primary Quiet
Default Label Label Label
Progressive Label Label Label
Destructive Label Label Label

Size

Size Wikitext Text button Icon-only button
Small {{Button|label=Label|link=Main Page|size=small}} Label
Medium {{Button|label=Label|link=Main Page|size=medium}} Label
Large {{Button|label=Label|link=Main Page|size=large}} Label

With icon

{{Button|label=Previous|link=Main Page|icon=CdxIconArrowNext.svg}} Label

Icon-only button

{{Button|label=Previous|link=Main Page|icon=CdxIconArrowNext.svg|iconOnly=true}}

TemplateData

Renders a generic button component

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Labellabel

Label text

Stringrequired
Page namelink

Page name to link to

Page namesuggested
URLurl

URL to link to

URLsuggested
Button actionaction

no description

Suggested values
default progressive destructive
Default
default
Stringsuggested
Button weightweight

no description

Suggested values
normal primary
Default
normal
Stringsuggested
Button sizesize

no description

Suggested values
small medium large
Default
medium
Stringoptional
Disableddisabled

Whether the button is disabled

Booleanoptional