Create a button element that can affect a widget from Template:Calculator
Parameter | Description | Type | Status | |
---|---|---|---|---|
for | for | id of Calculator field that is the target of this button | String | required |
formula | formula | Formula to set the field from the for parameter to
| String | required |
contents | contents 1 | Contents of the button
| Content | required |
type | type | Style of button. Default is "plain". The value of "default" means a codex default button, which is not the default of this template
| String | suggested |
alt | alt | Alt text of button for screen readers. Only use if the text content of the button would not be clear to a screen reader | String | optional |
class | class | 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" | String | optional |
class-live | class-live | Extra CSS classes that are only added if the calculator gadget is enabled | String | optional |
disabled | disabled | Formula to determine if the button should be disabled. Button becomes disabled when formula is true | String | optional |
id | id | id of button element | String | optional |
size | size | Size of button. medium is default
| String | optional |
style | style | Extra CSS for button | String | optional |
title | title | Tooltip for button | String | optional |
weight | weight | Weight of button (Ignored for plain buttons)
| String | optional |
role | role | Aria role for button. Typically you wouldn't need to set this. | Unknown | optional |
aria-live | aria-live | Value for aria-live attribute. Controls if screen readers announce changes. | Unknown | optional |
delay | delay | Make this be a repeating button. How many seconds between each repeat. Must be at least 0.5 seconds. | Number | optional |
max_iterations | max_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. | Number | optional |
toggle | toggle | 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. | Boolean | optional |