OGE logoOGE

Form

<oge-form> lays out the @oge-ui/inputs editors: labels, responsive columns, nestable <fieldset> groups, a validation summary and submit. Items come from projected <oge-form-item> children, from a data-driven items array, or both — children first.

The binding mode is derived from what you bind: [fieldTree] for Angular Signal Forms, [formGroup] for reactive forms, or [(formData)] for a plain signal model. That last one is not a second validation engine — the form compiles each item's validationRules into a Signal Forms schema and runs the very same code path.

Signal Forms reactive forms container queries a11y

Declarative items

Each <oge-form-item> names a model property through field. Dot-notation reaches nested objects. colSpan widens an item across the layout columns, and hint lands in the editor's own subscript so nothing shifts when an error replaces it.

[(formData)] field label colSpan hint
We never share it.

formData → Ada Lovelace

Data-driven items

The same item model as an array — useful when the fields come from a server. Entries render after any projected children, and visibleIndex reorders both sources together.

items editorOptions dataType

Editor selection

With no editorType, the editor follows dataType — and dataType itself is inferred from the current model value. An editorOptions.items list beats the inferred type (a select box), and an explicit editorType beats everything. Anything richer than the curated options belongs in a template, not in a reflective options bag.

dataType editorType editorOptions.items

Groups

A group renders a real <fieldset> with the caption as its <legend> — the markup screen readers expect for a labelled section — and carries its own column count. Groups nest.

<oge-form-group> caption colCount
Identity
Contact

Label placement

labelLocation: 'top' keeps each editor's own label chrome. 'start' and 'end' hand the label to the form, which draws a real <label for> in its own column — alignItemLabels gives every row the same label width so the editors line up.

labelLocation alignItemLabels showColonAfterLabel

Template slots

Four slots, each legal at form level (applies to every item) or inside a single <oge-form-item> (applies to that one, and wins). ogeFormEditorTemplate replaces only the control and keeps the label, required mark and error text — the context hands you editorId so your control keeps the <label for> association. ogeFormItemTemplate replaces the whole field, and ogeFormGroupCaptionTemplate replaces a legend's content.

ogeFormItemTemplate ogeFormEditorTemplate ogeFormLabelTemplate
3 / 5

Actions & submit

Project the buttons into the ogeFormActions slot. Submitting marks every field touched, runs validation, emits the cancelable submitting event and — only if both pass — submitted. A failed submit reveals the summary and moves focus to the first invalid field.

ogeFormActions submitted reset()