Beagle offers a lot of default Actions, however you can create a custom action.
To create an action on the front end of your application, you may check the section Simple Custom Action
To create this action in the backend and use it in a screen built there, your code should look like this:
@RegisterAction
data class CustomAction(
val msg: String? = null
) : Action
Check the example below for an Action set in a Button click:
{
"_beagleComponent_": "beagle:button",
"text": "Beagle Button",
"onPress": [
{
"_beagleAction_": "custom:customAction",
"msg": "Eu sou um Toast."
}
]
}
Button(
text = "Beagle Button",
onPress = listOf(CustomAction("Eu sou um Toast"))
)
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.