{button}
Sample Usage
Click count: {formtext: name=count; default=0}
{button: count = count + 1; label=Click me}
{button: count = count + 1; label=Click me}
_
Settings
Setting Name Type Description Positional code The code block to run when the button is clicked. label text The label for the button. General Command Settings trim yes/no/left/right If yes
whitespace is removed before and after the command. If left
, only whitespace to the left is removed. If right
, only whitespace to the right is removed.
Setting Name | Type | Description |
---|---|---|
Positional | code | The code block to run when the button is clicked. |
label | text | The label for the button. |
General Command Settings | ||
trim | yes/no/left/right | If yes whitespace is removed before and after the command. If left , only whitespace to the left is removed. If right , only whitespace to the right is removed. |
The {button}
command adds an interactive button to your snippet. When clicked, the button runs a code block.
Buttons do not insert any content when the snippet is inserted. They are only for building interfaces in form snippets.
Buttons are often used with the {run} command which allows you to execute a code block once.
Learn more about code blocks in the code block reference.