Widget Loaders
Widget loaders are a Record<string, () => Promise<unknown>> map that tells the form engine how to lazy-load each widget kind. The map key is the widget type (e.g. 'textinput', 'dropdown') and the value is an async loader that returns the widget implementation.
Default loaders
Section titled “Default loaders”Each framework adapter exports a widgetLoaders object preloaded with the GolemUI widget set:
import * as React from '@golemui/gui-react';// React.widgetLoaders covers every built-in input, layout, display, and action widget.Pass this as part of formConfig:
const formConfig = { widgetLoaders: React.widgetLoaders };Adding more
Section titled “Adding more”Spread the defaults and add your own custom widgets to the same map:
const formConfig = { widgetLoaders: { ...React.widgetLoaders, productCard: async () => (await import('./widgets/ProductCard')).ProductCard, },};The type key in the loader (productCard) must match the type field in your widget definitions.
See also
Section titled “See also”- Extending GolemUI / Widgets — building your own widget implementations.
- Form Definition API / Custom Widgets — declaring custom widget instances in the form.