Skip to main content
Widgets fire events you can subscribe to from a script via widget.on / widget.once / widget.off / widget.emit.

Subscribing

// Returns an unsubscribe function
const off = widget.on('mySlider', 'change', (value) => {
  console.log('slider is now', value);
});

// One-time
widget.once('myWidget', 'ready', () => { /* ... */ });

// Stop listening
off();
widget.off('mySlider', 'change');   // remove all 'change' handlers

Emitting

widget.emit('myWidget', 'update', newValue);

Event types

The full vocabulary, by group:
GroupEvents
Interactionclick, doubleclick, longpress, hover, focus, blur
Buttonpush, release
Inputchange, input, submit, keydown, keyup, keypress
Slider / RangeslideStart, slide, slideEnd
Switch / Toggletoggle, on, off
Lifecycleload, ready, destroy, update
Stateerror, success, loading, loaded
Selectionselect, deselect, optionchange
Touch / Gesturetouchstart, touchend, swipeleft, swiperight, swipeup, swipedown, pinch, zoom
Dragdragstart, drag, dragend
Timer / Animationtimeout, interval, animationstart, animationend
Datadataload, datafail, refresh
Not every widget fires every event — a Switch fires toggle/on/off, a Slider fires slide*. Lifecycle events (load, ready, destroy) apply to all.

Cleanup

Always keep the unsubscribe functions from on/once if your script sets up long-lived listeners, and call them when no longer needed to avoid duplicate handlers across re-runs.

See widget API

The methods these events pair with.