button Widget
The user can tap a button widget to perform a list of actions.
Attributes:
text: "My Button"
- Required
- Text to display on the button
- Must contain a non-whitespace symbol
actions: [action]
- A list of actions to perform when the user taps the button
- When the list is empty, the button is disabled.
Example
# Ruby
button(text: "Button", actions: [rpc("/add_item"), pop])
#![allow(unused)] fn main() { // Rust button("Button", [rpc("/add_item"), pop()]) }
Many Words
# Ruby
button(
text: "MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM",
actions: [rpc("/add_item"), pop]),
)
Long Word
# Ruby
button(
text: "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM",
actions: [rpc("/add_item"), pop]),
)
Disabled
# Ruby
button(text: "Disabled Button", actions: [])
#![allow(unused)] fn main() { // Rust button("Disabled Button", []) }