Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Create a button element that can affect a widget from Template:Calculator

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
forfor

id of Calculator field that is the target of this button

Stringrequired
formulaformula

Formula to set the field from the for parameter to

Example
x+1
Stringrequired
contentscontents 1

Contents of the button

Example
Click here
Contentrequired
typetype

Style of button. Default is "plain". The value of "default" means a codex default button, which is not the default of this template

Suggested values
plain default progressive desctructive
Default
plain
Example
progressive
Stringsuggested
altalt

Alt text of button for screen readers. Only use if the text content of the button would not be clear to a screen reader

Stringoptional
classclass

Extra CSS classes to add to the button. If you want this styled like a button even when the gadget is disabled add "cdx-button cdx-button--fake-button cdx-button--fake-button--enabled"

Stringoptional
class-liveclass-live

Extra CSS classes that are only added if the calculator gadget is enabled

Stringoptional
disableddisabled

Formula to determine if the button should be disabled. Button becomes disabled when formula is true

Stringoptional
idid

id of button element

Stringoptional
sizesize

Size of button. medium is default

Suggested values
medium large
Default
medium
Stringoptional
stylestyle

Extra CSS for button

Stringoptional
titletitle

Tooltip for button

Stringoptional
weightweight

Weight of button (Ignored for plain buttons)

Suggested values
normal primary quiet
Default
normal
Example
primary
Stringoptional
rolerole

Aria role for button. Typically you wouldn't need to set this.

Unknownoptional
aria-livearia-live

Value for aria-live attribute. Controls if screen readers announce changes.

Unknownoptional
delaydelay

Make this be a repeating button. How many seconds between each repeat. Must be at least 0.5 seconds.

Numberoptional
max_iterationsmax_iterations

How many times to repeat a button. Set to 0 to cancel any ongoing repeating button. If not set, then it is considered infinity if delay is set, otherwise 1.

Numberoptional
toggletoggle

If this is a repeating button, if set then when the user clicks the button a second time, it will stop the repeat. Otherwise a second click just restarts the repetition.

Booleanoptional