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.

import { gui } from '@golemui/gui-shared';
const formDef = [
// Triggers form-level validation, then emits a built-in 'submit' event.
gui.actions.submitButton({ label: 'Submit' }),
// A free-form button — emits whatever event name you provide.
gui.actions.button({ label: 'Cancel', on: { click: 'cancelForm' } }),
// Plug in your own action widget.
gui.actions.custom('productShare', { onClick: 'shareEvent' }),
];
ShortcutDescription
gui.actions.buttonA button widget (Button). Use onClick: 'submit' for the form-submit literal, or on: { click: '<eventName>' } for arbitrary events.
gui.actions.submitButtonA button preconfigured with onClick: 'submit'.
gui.actions.customPlug in your own action widget (Custom Widgets).

The same widget in JSON:

{
"form": [
{
"kind": "action",
"type": "button",
"label": "Submit",
"on": { "click": "submit" }
}
]
}
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.
onEvent wiring — typically { click: '<eventName>' }. Use 'submit' to trigger form-level validation.
propsWidget-specific configuration (icon, iconPosition, variant, etc.).