A focusable button. Pressing Enter or Space while it has focus sends a
"button.pressed" message, which you can handle with
on("button.pressed", "#id", function(event, app) ...).
Usage
button(
label = "Button",
id = NULL,
classes = NULL,
style = NULL,
disabled = FALSE,
variant = "default",
on_press = NULL
)Arguments
- label
Button text.
- id
Optional identifier (for
#idselectors).- classes
Optional classes (for
.classselectors).- style
A
style(). State stylesfocus,disabledandstates = list(pressed = ...)are supported.- disabled
Disabled buttons cannot be focused or pressed.
- variant
Colour variant:
"default","primary","success","warning"or"error".- on_press
Optional
function()(orfunction(event, app)) called when the button is pressed.