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.

{
"form": [
{
"kind": "action",
"type": "button",
"label": "Submit",
"actionType": "submit"
},
{
"kind": "action",
"type": "button",
"label": "Cancel",
"on": { "click": "cancelForm" }
},
{
"kind": "action",
"type": "productShare",
"on": { "click": "shareEvent" }
}
]
}
PropertyDescription
uidOptional unique id; one is generated if absent.
kindMANDATORY. Always 'action'.
typeMANDATORY. The action type (button is the only built-in).
labelVisible label text. Accepts a Localizable for i18n.
actionType'submit' — renders as <button type="submit">, validates the form, emits through formSubmit.
onEvent wiring for custom events — { click: '<eventName>' }. Emits through formEvent.
propsWidget-specific configuration (icon, iconPosition, variant, etc.).
WidgetDX shortcutReference
Buttongui.actions.buttonButton
Customgui.actions.customCustom Widgets