Skip to content

This how-to is for developers who need a page widget or a field control that the built-in ones do not cover. You will learn which kinds of plugin exist, which base classes and metadata each one needs, how to register it so builders can pick it, and how to ship it. Two minimal worked examples — a widget and a field control — are modelled on plugins already in the code.

You need:

  • A checkout of the web frontend (an Nx workspace with Angular) that you can run locally. See Run the platform from source.
  • Working knowledge of Angular standalone components, signals and ControlValueAccessor.
  • A way to build and deploy your own web image, and access to the deployment’s org-config.json (for widgets).

Every widget and field control — built-in or yours — is a lazily loaded Angular component with a name. Two things make a component usable:

  1. An expose: the name mapped to a loader that imports the component.
  2. Metadata: what the builder shows (its label and icon), what kind of component it is and which component it pairs with.

A plugin module config (InternalPluginModuleConfig from @osos/shared/types) holds both lists:

export interface InternalPluginModuleConfig {
exposes: Array<{ name: string; loadModuleProxy: () => PromiseLike<{ default: ModuleProxy<unknown> }> }>;
metadata: ComponentRegisterDataModel[];
}

At start-up the web app imports each plugin module config, registers its exposes with the component factory and stores its metadata. When a page or a form needs a component, the platform looks it up by name and loads it.

The in-repo plugin packs live in apps/core/src/app/shared/custom-plugins/:

PackContains
composite-summaries-widget (root index.ts)The Composite Summaries widget.
diwanWidgets such as QR code, quick counters, quick summaries, links grid, footer, attendance, v-card and sign-in.
gateTimeline slider widgets.
task-mgmtWidgets such as welcome title, quick links, hero slider and wiki, and an entry template.

The built-in field controls are registered the same way, from libs/shared/dynamic-fields.

The kind is the metadata’s type (ComponentType from @osos/shared/types). The base classes come from @osos/shared/plugin-cdk — always import from that barrel; deep imports into the library do not resolve.

KindComponentTypeBase classMetadata helper
Widget (shown on a page)WidgetComponentDynamicWidgetViewBase<TConfig>createWidgetComponentMetadata
Widget settings (in the widget dialog)WidgetConfigComponentDynamicWidgetConfigBase<TConfig>— (named by the widget’s metadata)
Field control, editFieldControlEditComponentDynamicComponentBase<DataType, ValueType>createComponentMetadata
Field control, read-onlyFieldControlViewComponentDynamicFieldControlViewBase<DataType, ValueType>createComponentMetadata
Field blockFieldBlockEditComponent, FieldBlockViewComponentDynamicFieldBlockEditBasecreateFieldBlockComponentMetadata
Entry templateEntryTemplateEditComponent, EntryTemplateViewComponent, EntriesListTemplateViewComponentDynamicEditEntryTemplateBase, DynamicEntryViewTemplateBase, DynamicListViewTemplateBase, DynamicEntryTemplateViewBasecreateTemplateComponentMetadata

The kit also contains DynamicActionBase and DynamicEventConfigBase for the configuration screens of automations. Those are wired directly in the platform’s own code, not through plugin registration.

This page covers widgets and field controls.

A widget is a pair: a view component that renders on the page and a config component that the builder fills in. The config component’s value is saved as the widget’s options, and the view reads it back as this.config.

The example below is a Greeting widget, modelled on the task-mgmt Welcome Title widget (task-mgmt/widgets/welcom-title-view and welcom-title-config).

apps/core/src/app/shared/custom-plugins/acme/
index.ts
plugin-module.config.ts
widgets/
metadata.ts
greeting/
greeting-config.model.ts
metadata.ts
view/greeting-view.component.ts
view/greeting-view.proxy.ts
config/greeting-config.component.ts
config/greeting-config.proxy.ts
greeting-config.model.ts
export interface GreetingConfig {
message: string;
showDate: boolean;
}
view/greeting-view.component.ts
import { DatePipe } from '@angular/common';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { DynamicWidgetViewBase } from '@osos/shared/plugin-cdk';
import { GreetingConfig } from '../greeting-config.model';
@Component({
selector: 'acme-greeting-view',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [DatePipe],
template: `
<section class="p-4">
<h3 class="my-0">{{ config.message || 'Welcome' }}</h3>
@if (config.showDate) {
<p>{{ today | date: 'fullDate' }}</p>
}
</section>
`,
})
export class AcmeGreetingViewComponent extends DynamicWidgetViewBase<GreetingConfig> {
readonly today = new Date();
}

DynamicWidgetViewBase gives you these inputs, set by the page:

MemberTypeMeaning
widgetGenericViewWidgetPresenterModel | undefinedThe placed widget: component, title, description, icon, displayOptions, options.
configTConfigShortcut for widget.options — your saved settings ({} until set).
previewbooleanThe widget is shown in the page designer.
readonlybooleanThe page is shown read-only.
hasGroupContainerbooleanThe widget sits inside a section or column.
isAutoRefresh, autoRefreshIntervalboolean, number | undefinedThe page’s auto-refresh setting.
destroy$ReplaySubject<void>Emits when the widget is destroyed.

The config component is a ControlValueAccessor and a Validator: the widget dialog writes the saved settings in and reads every change back.

config/greeting-config.component.ts
import { ChangeDetectionStrategy, Component, DestroyRef, forwardRef, inject, OnInit } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormBuilder, NG_VALUE_ACCESSOR, ReactiveFormsModule, ValidationErrors } from '@angular/forms';
import { DynamicWidgetConfigBase } from '@osos/shared/plugin-cdk';
import { GreetingConfig } from '../greeting-config.model';
@Component({
selector: 'acme-greeting-config',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ReactiveFormsModule],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => AcmeGreetingConfigComponent),
multi: true,
},
],
template: `
<div class="flex flex-col gap-2" [formGroup]="form">
<label for="greeting-message">Message</label>
<input id="greeting-message" type="text" formControlName="message" />
<label>
<input type="checkbox" formControlName="showDate" /> Show today's date
</label>
</div>
`,
})
export class AcmeGreetingConfigComponent
extends DynamicWidgetConfigBase<GreetingConfig>
implements OnInit
{
private readonly fb = inject(FormBuilder);
private readonly destroyRef = inject(DestroyRef);
readonly form = this.fb.nonNullable.group({
message: '',
showDate: true,
});
ngOnInit(): void {
this.form.valueChanges
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((value) => this._onChange?.(value as GreetingConfig));
}
writeValue(value: GreetingConfig): void {
if (value) {
this.form.patchValue(value, { emitEvent: false });
}
}
validate(): ValidationErrors | null {
return this.form.controls.message.value ? null : { messageRequired: true };
}
}

DynamicWidgetConfigBase provides componentModel (your widget’s registered metadata), _onChange, _onTouched, _onValidationChange, disabled, readonly and destroy$. You implement writeValue and validate; while validate returns errors, the dialog’s DONE button stays disabled.

Each loadable component has a proxy file whose default export is a ModuleProxy.

view/greeting-view.proxy.ts
import { ModuleProxy } from '@osos/shared/types';
import { AcmeGreetingViewComponent } from './greeting-view.component';
const moduleProxy: ModuleProxy<AcmeGreetingViewComponent> = {
component: AcmeGreetingViewComponent,
};
export default moduleProxy;

Write config/greeting-config.proxy.ts the same way for AcmeGreetingConfigComponent.

widgets/greeting/metadata.ts
import { createWidgetComponentMetadata } from '@osos/shared/plugin-cdk';
import { ComponentType } from '@osos/shared/types';
export default createWidgetComponentMetadata({
customPlugin: true,
componentName: 'ACME/GreetingWidget',
type: ComponentType.WidgetComponent,
name: { en: 'Greeting', ar: 'ترحيب' },
icon: 'icon-title',
preferredPairedComponents: [
{ name: 'ACME/GreetingWidgetConfig', type: ComponentType.WidgetConfigComponent },
],
options: {
defaultOptions: { display: { width: 12 } },
validations: {
width: { enabled: true, options: { availableWidths: [6, 8, 12] } },
},
},
});
KeyMeaning
componentNameThe widget’s name. It must equal the view’s expose name. In-repo packs prefix it (TMGMT/, GATE/, DIWAN/).
customPlugintrue hides the widget until the deployment lists it in PAGE_CUSTOM_PLUGIN (below).
name, iconThe label and icon in the page designer’s Widgets panel.
preferredPairedComponentsThe settings component, by its expose name, with type WidgetConfigComponent.
options.defaultOptions.display.widthThe starting width in columns.
options.validations.width.options.availableWidthsThe widths a builder may choose.

Collect the pack’s metadata in widgets/metadata.ts:

import { ComponentRegisterDataModel } from '@osos/shared/types';
import greetingWidgetMetadata from './greeting/metadata';
export const DYNAMIC_WIDGETS_METADATA = Array<ComponentRegisterDataModel>(
greetingWidgetMetadata,
);
plugin-module.config.ts
import { InternalPluginModuleConfig } from '@osos/shared/types';
import { DYNAMIC_WIDGETS_METADATA } from './widgets/metadata';
const pluginModuleConfig: InternalPluginModuleConfig = {
exposes: [
{
name: 'ACME/GreetingWidget',
loadModuleProxy: () => import('./widgets/greeting/view/greeting-view.proxy'),
},
{
name: 'ACME/GreetingWidgetConfig',
loadModuleProxy: () => import('./widgets/greeting/config/greeting-config.proxy'),
},
],
metadata: DYNAMIC_WIDGETS_METADATA,
};
export default pluginModuleConfig;
index.ts
import PluginModuleConfig from './plugin-module.config';
export { PluginModuleConfig };

Add your pack to the list the web app loads at start-up, in apps/core/src/app/app.component.ts, method _initInternalPlugins():

merge(
import('@osos/shared/dynamic-fields'),
import('@osos/feature/entry-templates'),
import('./shared/dynamic-widgets-components'),
import('./shared/custom-plugins/task-mgmt'),
import('./shared/custom-plugins/gate'),
import('./shared/custom-plugins/diwan'),
import('./shared/custom-plugins'),
import('./shared/custom-plugins/acme'), // your pack
)

Each imported module must export PluginModuleConfig.

9. Switch the widget on for the deployment

Section titled “9. Switch the widget on for the deployment”

A widget whose metadata says customPlugin: true appears only when its componentName is listed in PAGE_CUSTOM_PLUGIN in the web app’s org-config.json:

{
"PAGE_CUSTOM_PLUGIN": ["ACME/GreetingWidget"]
}

The repository’s apps/core/src/org-config.json lists the in-repo widgets. In a Helm deployment the file comes from the chart value web.orgConfig, whose default has no PAGE_CUSTOM_PLUGIN — add the key there, next to the branding keys. See Helm chart.

A field control is also a pair: an edit component for forms and a view component for details and lists. Once registered, the edit component appears as a new field type in the entity designer, and the field stores which edit and view components it uses.

The example below is a Star rating control for a Number field, modelled on the built-in Year control (libs/shared/dynamic-fields/.../components/year and view-dynamic-components/view-year).

star-rating.component.ts
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { AbstractControl, ValidationErrors, Validators } from '@angular/forms';
import { DynamicComponentBase, NumberDataType } from '@osos/shared/plugin-cdk';
import { DataTypeEnum } from '@osos/shared/types';
@Component({
selector: 'acme-star-rating',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
@if (field) {
<div class="flex gap-1" [class]="styleClass" [attr.data-testid]="uid">
@for (star of stars; track star) {
<button
type="button"
[disabled]="disabled || elementDisabled || readOnly"
[attr.aria-label]="star + ' of 5'"
(click)="select(star)"
(blur)="_onTouched?.()"
>{{ star <= (value ?? 0) ? '★' : '☆' }}</button>
}
</div>
}
`,
})
export class AcmeStarRatingComponent extends DynamicComponentBase<
DataTypeEnum.Number,
NumberDataType
> {
readonly stars = [1, 2, 3, 4, 5];
writeValue(value: NumberDataType): void {
this.value = typeof value === 'number' ? value : null;
}
validate(control: AbstractControl): ValidationErrors | null {
const mustFill =
this.required ?? !!this.field?.validations?.required?.enabled;
return mustFill ? Validators.required(control) : null;
}
select(star: number): void {
this.value = star;
this._onChange?.(star);
this._onTouched?.();
}
}

What DynamicComponentBase gives you, set by the form:

MemberTypeMeaning
valueValueTypeThe current value (signal-backed; setting it re-renders).
fieldFieldPresenterModel | undefinedThe field: normalizedName, name, dataType, validations, and renderOptions.editComponent.options for your own options.
mode'designer' | 'entry' | undefinedShown in the entity designer, or on a real form.
requiredboolean | undefinedForces required on or off; undefined means “use field.validations.required”.
readOnly, elementDisabled, disabledbooleanWhether the person may change the value.
placeholder, styleClass, uidstringPlaceholder text, CSS classes to apply, and a unique id for inputId/test ids.
ctrlErrorsTemplateRefTemplateRef | undefinedA template that renders the field’s errors, if you want to show them.
displayConfig{ mode: 'comfort' | 'compact' }Density.
searchModeEnabledboolean | undefinedThe control is used as a search filter; report changes with _mappedSearchValueChange instead of _onChange (see the Year control).
_onChange, _onTouchedfunctionsCall them when the value changes and when the control is left.

You implement writeValue(value) and validate(control). Emit a value in the shape the field’s data type uses — for DataTypeEnum.Number that is NumberDataType (number, or a pair for ranges).

view-star-rating.component.ts
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { DynamicFieldControlViewBase, NumberDataType } from '@osos/shared/plugin-cdk';
import { DataTypeEnum } from '@osos/shared/types';
@Component({
selector: 'acme-view-star-rating',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
@if (rating) {
<span [class]="styleClass" [attr.aria-label]="rating + ' of 5'">
@for (star of stars; track star) {
{{ star <= rating ? '★' : '☆' }}
}
</span>
}
`,
})
export class AcmeViewStarRatingComponent extends DynamicFieldControlViewBase<
DataTypeEnum.Number,
NumberDataType
> {
readonly stars = [1, 2, 3, 4, 5];
get rating(): number {
return typeof this.value === 'number' ? this.value : 0;
}
}

DynamicFieldControlViewBase gives you value, field, displayConfig, viewType (where it is shown), fieldControlConfig, styleClass and searchValues.

Add a proxy file for each component, exactly as for the widget.

import { createComponentMetadata } from '@osos/shared/plugin-cdk';
import { ComponentType, DataTypeEnum } from '@osos/shared/types';
export const STAR_RATING_METADATA = createComponentMetadata({
specificationVersion: 1,
name: { en: 'Star rating', ar: 'تقييم بالنجوم' },
componentName: 'ACME/StarRatingComponent',
dataTypes: [DataTypeEnum.Number],
type: ComponentType.FieldControlEditComponent,
componentOptions: [],
preferredPairedComponents: [
{ name: 'ACME/ViewStarRatingComponent', type: ComponentType.FieldControlViewComponent },
],
icon: 'number',
});
export const VIEW_STAR_RATING_METADATA = createComponentMetadata({
specificationVersion: 1,
name: { en: 'View-star-rating', ar: 'عرض التقييم بالنجوم' },
componentName: 'ACME/ViewStarRatingComponent',
dataTypes: [DataTypeEnum.Number],
type: ComponentType.FieldControlViewComponent,
componentOptions: [],
preferredPairedComponents: [
{ name: 'ACME/StarRatingComponent', type: ComponentType.FieldControlEditComponent },
],
icon: 'number',
});

When a builder adds the field, the platform takes the data type from dataTypes[0], the edit component from componentName and the view component from the first entry of preferredPairedComponents. Other keys you may set mirror the built-in controls: supportDefaultValue (default true), supportUniqueOption, supportSearchable, fieldQueryOptions and displayOptions.

createComponentMetadata always sets customPlugin: false, so a field control is available as soon as it is registered — it does not use PAGE_CUSTOM_PLUGIN.

Put both exposes and both metadata entries in a plugin module config — your own pack’s (as in step 7) or a new one — and make sure the pack is in _initInternalPlugins() (step 8).

exposes: [
{ name: 'ACME/StarRatingComponent', loadModuleProxy: () => import('./fields/star-rating/star-rating.proxy') },
{ name: 'ACME/ViewStarRatingComponent', loadModuleProxy: () => import('./fields/star-rating/view-star-rating.proxy') },
],
metadata: [...DYNAMIC_WIDGETS_METADATA, STAR_RATING_METADATA, VIEW_STAR_RATING_METADATA],
  1. Run the web app locally (pnpm start) and try the plugin — see Use it in the builder.
  2. Build the web app (pnpm build) and produce your web image the way your pipeline does.
  3. Deploy the new image.
  4. For a widget, add its componentName to PAGE_CUSTOM_PLUGIN in the deployment’s org-config.json (web.orgConfig in Helm). A field control needs no extra step.

A widget.

  1. Open a page: Administration › Applications › Pages, then the page (or New Page).
  2. On the Content tab, find your widget by its name in the Widgets panel and add it.
  3. In the widget dialog, your settings component appears on the Content tab, next to General. Fill it in and select DONE.
  4. Save the page.

See Pages and widgets.

A field control.

  1. Open the entity’s designer: Administration › Applications › Data Entities, then Edit Entity on the entity card.
  2. On the Structure tab, your control is listed by its name in the Fields palette. Drag it onto the form.
  3. Configure and Save as for any field.

See Create and design an entity.

SymptomLikely cause
The widget is not in the Widgets panel.Its componentName is missing from PAGE_CUSTOM_PLUGIN, or the pack is not in _initInternalPlugins().
The browser console shows [appDynamicWidgetView] Unknown or failed to load component: "…".The metadata’s componentName does not match an expose name, or the proxy has no default export with component.
[appDynamicWidgetConfig] Unknown or failed to load component when opening the widget dialog.preferredPairedComponents names a settings component that is not exposed.
The field type is missing from the Fields palette.The metadata’s type is not FieldControlEditComponent, or the pack is not registered.
A field shows an empty value in details or lists.The view component’s name in preferredPairedComponents[0] is not exposed.

Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27