← Back
Action
The action
component allows you to add event handlers to text. For example:
Input:
This is regular text, but when you
[action onClick:`alert('clicked the text')`]click me[/action],
an alert will appear.
Output:
Props
- onClick
event
An event that is triggered when a reader clicks.
- Example:
`alert("You clicked the text.")`
- Example:
- onMouseEnter
event
An event that is triggered when a reader mouses over the element, e.g.
x = true
. - onMouseLeave
event
An event that is triggered when a reader removes their mouse from the element, e.g.
x = false
.