OGE logoOGE

Forms API

Full surface of @oge-ui/forms: the form itself, the two renderless configuration children, the standalone validation summary, and the application-wide configuration provider.

Properties Methods Events Types

OgeForm

oge-form

Properties 27

Binding

Name Type DefaultDescription
fieldTreeFieldTree<T> | undefinedundefinedAn Angular Signal Forms tree, as returned by form(). The caller owns validation, required marks, disabled and readonly state.
formGroupFormGroup | undefinedundefinedA reactive FormGroup. Each item binds its matching control through the editors' control-value-accessor path.
formDataT | undefinedundefinedA plain model object — two-way. The form builds its own Signal Forms tree over it, compiling each item's validationRules into the schema.
itemsreadonly OgeFormItemData[] | undefinedundefinedData-driven items, rendered after the projected <oge-form-item> children.
groupsreadonly OgeFormGroupData[] | undefinedundefinedData-driven groups, matched to items by key (or caption) through an item's group.
modeSignal&lt;OgeFormMode&gt;—Read-only: which binding the form resolved to. Derived from the bound inputs, never configured.

Layout

Name Type DefaultDescription
colCountnumber | 'auto''auto'Layout columns. 'auto' fits as many minColWidth tracks as the form is wide.
colCountByScreenPartial&lt;Record&lt;OgeFormScreenSize, number&gt;&gt; | undefinedundefinedColumn count per breakpoint. Implemented as container queries on the form itself, so a form in a dialog or a grid cell sizes from its own width — not the window's.
minColWidthnumber220Narrowest column colCount: 'auto' will produce, in pixels.
labelLocation'top' | 'start' | 'end''top''top' keeps each editor's own label chrome; the side values hand the label to the form, which draws a real <label for> in its own column.
labelMode'static' | 'floating' | 'hidden' | 'outside''static'Forwarded to every editor. Forced to 'hidden' when labelLocation is a side value, so no label renders twice.
alignItemLabelsbooleantrueGives side labels one shared column width so the editors line up.
showColonAfterLabelbooleanfalseAppends messages.labelColon to every label.
showRequiredMarkbooleantrueRenders messages.requiredMark after a required label, aria-hidden, with a screen-reader-only word beside it.
showOptionalMarkbooleanfalseRenders messages.optionalMark after every non-required label.
size'sm' | 'md' | 'lg''md'Forwarded to every editor.
stylingMode'outlined' | 'filled' | 'underlined''outlined'Forwarded to every editor.
subscriptSizing'fixed' | 'dynamic' | 'none''fixed'Forwarded to every editor. 'fixed' reserves the hint/error line so an appearing error never shifts the layout.

State

Name Type DefaultDescription
readOnlybooleanfalseMakes every editor read-only, overridable per group and per item. In [fieldTree] mode use the schema's readonly() instead.
disabledbooleanfalseWraps the fields in a <fieldset disabled>. In [fieldTree] mode use the schema's disabled() — the FormField directive writes the editor's disabled input itself.
showValidationSummarybooleanfalseRenders an <oge-validation-summary> above the fields once a submit has failed.
scrollToFirstInvalidbooleantrueScrolls the first invalid field into view when a submit fails. Focus moves there either way.
errorsSignal&lt;readonly OgeFormErrorEntry[]&gt;—Read-only: one entry per invalid field, in layout order, regardless of whether the field is showing its error yet.
validSignal&lt;boolean&gt;—Read-only: whether every bound field currently validates.
dirtySignal&lt;boolean&gt;—Read-only: whether any bound field has been edited since the last reset. Works in all three binding modes.
messagesPartial&lt;OgeFormsMessages&gt; | undefinedundefinedPer-instance string overrides, merged over provideOgeFormsConfig().
renderFormElementbooleantrueWhether the fields are wrapped in a real <form>. Set false inside another form — nested forms are invalid HTML; the grid's row editor does exactly this. With false there is no native submit, so drive it with submit().

Methods 8

Name Type Description
submit(event?: Event)Promise&lt;boolean&gt;Marks every field touched, validates, emits submitting and then submitted. Resolves false when the form was invalid or the submit was canceled, and focuses the first invalid field.
validate()booleanRe-reads validity and emits validated. Does not move focus.
reset(values?: Partial&lt;T&gt;)voidResets every field to values, or to the bound form's initial data, and hides the validation summary.
clear()voidEmpties every editor using the per-dataType empty value ('', null, false, []).
focus(field?: string)voidFocuses a named field, or the first one when called with no argument.
focusFirstInvalid()booleanFocuses — and, with scrollToFirstInvalid, scrolls to — the first invalid field. Returns false when the form is valid.
itemOption(field: string)OgeResolvedFormItem | undefinedThe resolved configuration of one item, as the form actually renders it. Replaces the reference libraries' getEditor(), which hands out a component instance.
updateData(field: string, value: unknown)voidWrites one field. The overload updateData(partial) merges an object into the bound data.

Events 5

Name Type Description
submittingOgeFormSubmittingEvent&lt;T&gt;Cancelable pre-submit — { data, valid, cancel, event }. Set cancel to stop the submit.
submittedOgeFormSubmittedEvent&lt;T&gt;Emitted after a submit passed validation and was not canceled.
fieldChangedOgeFormFieldChangedEventOne field's value changed — { field, value, previousValue }.
validatedOgeFormValidatedEventEmitted after validate() or a submit attempt — { valid, errors }.
editorEnterKeyOgeFormKeyEventEnter pressed inside an editor — { field, event }.

Types 10

Name Type Description
OgeFormMode'fieldTree' | 'formGroup' | 'formData'Which binding the form resolved to.
OgeFormDataType'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'dateRange' | 'array' | 'object'Value shape of an item. Inferred from the model value when not set.
OgeFormEditorType'textBox' | 'textArea' | 'numberBox' | 'selectBox' | 'tagBox' | 'autocomplete' | 'treeSelect' | 'dateBox' | 'dateRangeBox' | 'calendar' | 'checkBox' | 'switch' | 'radioGroup'Which @oge-ui/inputs editor renders an item. House camelCase names, not the reference libraries' class names.
OgeFormLabelLocation'top' | 'start' | 'end'Where an item's label sits relative to its editor.
OgeFormScreenSize'xs' | 'sm' | 'md' | 'lg' | 'xl'Container-query breakpoints: under 480, then 480 / 720 / 960 / 1200 pixels of form width.
OgeFormColCountnumber | 'auto'A fixed track count, or auto-fit by minColWidth.
OgeValidationRule{ type: 'required' | 'email' | 'numeric' | 'stringLength' | 'pattern' | 'range' | 'custom' | 'async'; … }A declarative rule. Compiled into an Angular Signal Forms schema — there is no second validation engine.
OgeValidationContext{ value: unknown; data: Record&lt;string, unknown&gt; }What a custom rule sees: its own value and the whole model, which is what makes cross-field rules possible.
OgeFormErrorEntry{ field: string; label: string; message: string }One row of the validation summary.
OgeResolvedFormIteminterfaceAn item after label defaulting, dataType inference, editor selection and state inheritance — what itemOption() returns.

OgeFormItem

oge-form-item

Properties 17

Name Type DefaultDescription
fieldstring—Required. Model property this item edits; dot-notation reaches nested objects.
keystring | undefinedundefinedStable identity; defaults to field.
labelstring | undefinedundefinedLabel text. Defaults to a title-cased field — postalCode becomes “Postal code”.
labelVisiblebooleantrueSet false to render the editor with no label.
hintstring | undefinedundefinedHelp text under the editor. Chrome editors render it in their own subscript; bare controls get it from the form.
placeholderstring | undefinedundefinedPlaceholder forwarded to the editor.
dataTypeOgeFormDataType | undefinedundefinedValue shape. Inferred from the current model value when omitted.
editorTypeOgeFormEditorType | undefinedundefinedExplicit editor; beats both editorOptions.items and dataType.
editorOptionsOgeFormEditorOptions | undefinedundefinedA curated, typed subset of editor inputs (items, displayExpr, min, max, rows, …). Supplying items selects a select box or tag box.
colSpannumber1Layout columns the item spans, clamped to the column count in force.
visiblebooleantrueA hidden item is dropped from the layout entirely — no hidden input, no stale DOM value.
visibleIndexnumber | undefinedundefinedItems with an index come first, in index order; everything else keeps its declaration order behind them.
isRequiredbooleanfalseAdds a required rule and shows the required mark.
validationRulesreadonly OgeValidationRule[] | undefinedundefinedDeclarative rules, compiled into the form's Signal Forms schema. Ignored — with a dev-mode warning — when the form is bound with [fieldTree] or [formGroup].
readOnlyboolean | undefinedundefinedundefined falls back to the enclosing group, then the form.
disabledboolean | undefinedundefinedundefined falls back to the enclosing group, then the form.
cssClassstring | undefinedundefinedExtra class on the item wrapper.

OgeFormGroup

oge-form-group

Properties 9

Name Type DefaultDescription
captionstring''Legend text. An empty caption renders an unlabelled section.
keystring | undefinedundefinedStable identity; defaults to the caption.
colCountOgeFormColCount | undefinedundefinedColumns inside this group; undefined inherits the form's count.
colSpannumber1Columns the group itself spans in its parent layout.
visiblebooleantrueDrops the whole section, and its items, from the layout.
disabledboolean | undefinedundefinedDisables every item in the section, unless the item overrides it.
readOnlyboolean | undefinedundefinedMakes every item in the section read-only, unless the item overrides it.
visibleIndexnumber | undefinedundefinedExplicit ordering among this group's siblings. Ordering is scoped per level, the way the reference libraries scope it.
cssClassstring | undefinedundefinedExtra class on the fieldset.

OgeValidationSummary

oge-validation-summary

Properties 2

Name Type DefaultDescription
errorsreadonly OgeFormErrorEntry[][]One entry per invalid field, in layout order. Bind form.errors().
messagesPartial&lt;OgeFormsMessages&gt; | undefinedundefinedPer-instance string overrides.

Events 1

Name Type Description
errorClickOgeFormErrorEntryA summary row was activated. Bind it to form.focus($event.field).

Sections

Properties 18

OgeFormTabs — <oge-form-tabs>

Name Type DefaultDescription
selectedIndexnumber0Open tab — two-way. A failed submit sets it to the tab holding the first invalid field.
deferRenderingbooleanfalseDeliberately the opposite of the tab panel's own default: a form usually wants every field in the DOM. Validation runs on the model either way.
keepAlivebooleantrueKeeps a rendered tab's fields mounted while it is hidden.
showErrorBadgesbooleantrueShows each tab's invalid-field count as a badge on the tab.
key / visible / visibleIndex / colSpan / cssClassstring | boolean | number | undefined—The same section-level knobs a group has.

OgeFormSteps — <oge-form-steps>

Name Type DefaultDescription
activeIndexnumber0Active step — two-way. A failed submit moves to the step holding the first invalid field.
linearbooleanfalseBlocks moving past a step that still has invalid fields. Completion comes from the form's own per-step error rollup, so it behaves identically in all three binding modes.
orientation'horizontal' | 'vertical''horizontal'Passed through to the stepper.
showNavigationbooleantrueRenders the stepper's built-in Back / Next bar. On by default here, because a wizard inside a form almost always wants one.
touchOnLeavebooleantrueTouches only the leaving step's fields on each advance, so the steps ahead stay quiet instead of turning red — which a plain markAllAsTouched() would cause.
showInvalidSectionsbooleantrueFlags a step whose fields are invalid, driving the stepper's error indicator.
deferRendering / keepAliveboolean—See OgeFormTabs — same defaults, same reasoning.
key / visible / visibleIndex / colSpan / cssClassstring | boolean | number | undefined—The same section-level knobs a group has.

OgeFormAccordion — <oge-form-accordion>

Name Type DefaultDescription
expandedKeysreadonly string[][]Expanded panels — two-way. A failed submit adds the panel holding the first invalid field.
multiplebooleantrueWhether more than one panel may be open at a time.
collapsiblebooleantrueWhether the open panel may be closed again.
showInvalidSectionsbooleantrueDrives the accordion's own invalid indicator — danger rail, dot and screen-reader label — from the panel's field errors.
deferRendering / keepAliveboolean—As on <oge-form-tabs>.

Template slots

Properties 5

Slots

Name Type Description
ogeFormItemTemplatedirective — [ogeFormItemTemplate]Replaces a field entirely: label, editor and error text. Legal at form level (every item) or inside one <oge-form-item>, where it wins.
ogeFormEditorTemplatedirective — [ogeFormEditorTemplate]Replaces only the control, keeping the form's label, required mark and error chrome. The escape hatch for anything editorOptions cannot express.
ogeFormLabelTemplatedirective — [ogeFormLabelTemplate]Replaces the label content. The surrounding <label for> stays, so the control association and the required mark survive.
ogeFormGroupCaptionTemplatedirective — [ogeFormGroupCaptionTemplate]Replaces the content of a group's <legend>. The fieldset/legend pair itself stays — that is what makes the section a labelled group.
ogeFormActionsdirective — [ogeFormActions]Marks the projected action bar (submit, reset, …). A typed marker rather than a bare attribute.

Types 3

Name Type Description
OgeFormItemTemplateContext{ $implicit: OgeResolvedFormItem; item; field; control; error; editorId }Context of the item and editor slots. field is the Signal Forms node (bind with [formField]), control the reactive one, and editorId the id the form's <label for> points at.
OgeFormLabelTemplateContext{ $implicit: string; item; required; editorId }Context of the label slot; $implicit is the resolved label text.
OgeFormGroupCaptionTemplateContext{ $implicit: string }Context of the group caption slot.

Schema metadata

Properties 10

Schema-carried layout

Name Type Description
OGE_FORM_LABELMetadataKey&lt;string&gt;Label text, set with metadata(path, OGE_FORM_LABEL, () => '…') in a Signal Forms schema.
OGE_FORM_HINTMetadataKey&lt;string&gt;Help text under the editor.
OGE_FORM_PLACEHOLDERMetadataKey&lt;string&gt;Editor placeholder.
OGE_FORM_COL_SPANMetadataKey&lt;number&gt;Layout columns the field spans.
OGE_FORM_EDITORMetadataKey&lt;OgeFormEditorType&gt;Explicit editor for the field.
OGE_FORM_EDITOR_OPTIONSMetadataKey&lt;OgeFormEditorOptions&gt;Curated editor inputs.
OGE_FORM_DATA_TYPEMetadataKey&lt;OgeFormDataType&gt;Value shape, when the live value is not descriptive enough.
OGE_FORM_GROUPMetadataKey&lt;string&gt;Caption of the group the field belongs to; the group is created on demand.
OGE_FORM_ORDERMetadataKey&lt;number&gt;Ordering hint, equivalent to an item's visibleIndex.
itemFromMetadata(field, node)OgeFormItemData | undefinedBuilds one item description from a field's metadata; undefined for a field the schema hid with hidden().

Forms configuration

Properties 18

provideOgeFormsConfig()

Name Type DefaultDescription
labelLocationOgeFormLabelLocation | undefined'top'Application-wide default for the input of the same name.
minColWidthnumber | undefined220Application-wide default for the input of the same name.
showRequiredMarkboolean | undefinedtrueApplication-wide default for the input of the same name.
showOptionalMarkboolean | undefinedfalseApplication-wide default for the input of the same name.
showColonAfterLabelboolean | undefinedfalseApplication-wide default for the input of the same name.

OgeFormsMessages

Name Type DefaultDescription
requiredMarkstring'*'Marker after a required label; rendered aria-hidden.
optionalMarkstring'optional'Marker after an optional label.
requiredLabelstring'required'Screen-reader text beside the required mark.
optionalLabelstring'optional'Screen-reader text beside the optional mark.
labelColonstring':'Separator drawn when showColonAfterLabel.
validationSummaryTitlestring'{count} fields need your attention'Summary heading; {count} is interpolated.
validationSummaryTitleOnestring'1 field needs your attention'Summary heading when exactly one field is invalid.
validationSummaryLabelstring'Validation summary'Accessible label of the summary region.
invalidErrorstring'This value is invalid'Fallback text for an error with no resolvable message.
submitButtonstring'Submit'Label of the built-in submit button.
resetButtonstring'Reset'Label of the built-in reset button.
submittingstring'Submitting…'Announced while an async submit handler is in flight.
noItemsstring'No fields to display'Shown when no visible item resolves.