Event Triggers
Components can modify the state based on user events such as clicking a button or entering text in a field. These events are triggered by event triggers.
Event triggers are component specific and are listed in the documentation for each component.
on_focus
The on_focus event handler is called when the element (or some element inside of it) receives focus. For example, it’s called when the user clicks on a text input.
on_blur
The on_blur event handler is called when focus has left the element (or left some element inside of it). For example, it’s called when the user clicks outside of a focused text input.
on_change
The on_change event handler is called when the value of an element has changed. For example, it’s called when the user types into a text input each keystoke triggers the on change.
on_click
The on_click event handler is called when the user clicks on an element. For example, it’s called when the user clicks on a button.
on_context_menu
The on_context_menu event handler is called when the user right-clicks on an element. For example, it’s called when the user right-clicks on a button.
on_double_click
The on_double_click event handler is called when the user double-clicks on an element. For example, it’s called when the user double-clicks on a button.
on_mount
The on_mount event handler is called after the component is rendered on the page. It is similar to a page on_load event, although it does not necessarily fire when navigating between pages.
on_unmount
The on_unmount event handler is called after removing the component from the page. However, on_unmount will only be called for internal navigation, not when following external links or refreshing the page.
on_mouse_up
The on_mouse_up event handler is called when the user releases a mouse button on an element. For example, it’s called when the user releases the left mouse button on a button.
on_mouse_down
The on_mouse_down event handler is called when the user presses a mouse button on an element. For example, it’s called when the user presses the left mouse button on a button.
on_mouse_enter
The on_mouse_enter event handler is called when the user’s mouse enters an element. For example, it’s called when the user’s mouse enters a button.
on_mouse_leave
The on_mouse_leave event handler is called when the user’s mouse leaves an element. For example, it’s called when the user’s mouse leaves a button.
on_mouse_move
The on_mouse_move event handler is called when the user moves the mouse over an element. For example, it’s called when the user moves the mouse over a button.
on_mouse_out
The on_mouse_out event handler is called when the user’s mouse leaves an element. For example, it’s called when the user’s mouse leaves a button.
on_mouse_over
The on_mouse_over event handler is called when the user’s mouse enters an element. For example, it’s called when the user’s mouse enters a button.
on_scroll
The on_scroll event handler is called when the user scrolls the page. For example, it’s called when the user scrolls the page down.
Scroll to make the text below change.
Change Me!
Scroll to make the text above change.