Event Handler Data Types

Alpha: Editor React Components are currently in alpha. This feature is subject to change and may have bugs, issues, and limitations. We're actively improving it based on your feedback.

Event handler data types allow Wix users to attach standard DOM event handlers to their component. These types automatically wire up event handling in the editor and at runtime.

Available event handler types

All event handler types require no additional configuration. Just specify the dataType and optionally a displayName.

onClick

Standard onClick handler for click interactions.

Example

A click handler for button interactions:

Copy

onChange

Standard input event onChange for text inputs.

Example

An input change handler for a text field:

Copy

onKeyPress

Standard onKeyPress handler fired when a key is pressed.

Example

A key press handler for keyboard input:

Copy

onKeyUp

Standard onKeyUp handler fired when a key is released.

Example

A key up handler for keyboard events:

Copy

onKeyDown

Standard onKeyDown handler fired when a key is pressed down.

Example

A key down handler for keyboard navigation:

Copy

onFocus

Standard onFocus handler fired when an element receives focus.

Example

A focus handler for form validation:

Copy

onSubmit

Standard onSubmit handler for form submissions.

Example

A submit handler for form processing:

Copy

function

A custom function that can be passed in if there is a matching one defined.

Example

A custom function handler:

Copy
Did this help?