Skip to content

Action Widgets Overview

Action widgets trigger events. They don’t bind to form data and don’t render values — they emit named events that your application code handles via the formEvent callback, or trigger form submission through the formSubmit output.

import { gui } from '@golemui/gui-shared';
const formDef = [
// Validates the form on click, then emits through formSubmit.
gui.actions.button({ label: 'Submit', actionType: 'submit' }),
// A free-form button — emits whatever event name you provide via formEvent.
gui.actions.button({ label: 'Cancel', onClick: () => 'cancelForm' }),
// Plug in your own action widget.
gui.actions.custom('productShare', { onClick: () => 'shareEvent' }),
];

Use actionType: 'submit' to validate the form and emit through formSubmit, or onClick: () => 'eventName' for arbitrary events that route through formEvent.

WidgetDX shortcutReference
Buttongui.actions.buttonButton
Customgui.actions.customCustom Widgets