OGE logoOGE

Form layout

The layout is one CSS grid per level. colCount sets the track count, colSpan widens an item inside it, and groups may override the count for their own subtree.

Responsiveness is a container query, not a window-width callback: colCountByScreen keys off the form's own inline size, so a form inside a dialog, a drawer or a grid cell picks the right column count without any JavaScript resize listener.

colCount colSpan container queries fieldset

Fixed columns

A numeric colCount produces repeat(n, minmax(0, 1fr)). An item's colSpan is clamped to the count in force, so a span of 4 in a 2-column form spans 2 rather than overflowing.

colCount colSpan
columns:

Auto-fit columns

The default. repeat(auto-fit, minmax(minColWidth, 1fr)) fits as many columns as the form is wide, with no breakpoints to maintain. Resize the browser — or the card — and the count follows.

colCount=auto minColWidth

Responsive by container

Explicit counts per breakpoint when auto-fit is not precise enough. The breakpoints are container queries on the form itself — xs under 480px, then 480 / 720 / 960 / 1200 — so the same form nested in a narrow panel behaves like a phone layout even on a wide screen.

colCountByScreen @container

Nested groups

Groups nest as nested fieldsets, each with its own column count. That is the structure assistive technology reads as “this block of fields belongs together”, and it is why the group is a real fieldset rather than a styled div.

nested groups legend group colCount
Company
Billing address

Tab sections

Wrap the groups in <oge-form-tabs> and each group becomes a tab, its caption the tab text. The strip, its keyboard handling and its overflow come from @oge-ui/tabs — none of it is re-implemented. A tab holding invalid fields gets a count badge, and a failed submit selects that tab before focusing the field.

<oge-form-tabs> error badges focus reveal

Accordion sections

The same idea over @oge-ui/layout. A panel holding an invalid field gets the accordion's own invalid indicator — the danger rail, the dot and its screen-reader label — and a failed submit expands it.

<oge-form-accordion> invalid sections

Read-only & disabled

Form-level disabled wraps the fields in a <fieldset disabled>; readOnly forwards to every editor. Both fall through group level to item level, and an item may opt out. In [fieldTree] mode the schema owns this instead — express it with disabled() / readonly(), because the FormField directive writes those inputs itself.

readOnly disabled per-item override

Visibility & order

visible drops an item from the layout entirely — no hidden input, no stale value in the DOM. visibleIndex pulls items to the front in index order; everything without one keeps its declaration order behind them.

visible visibleIndex