Skip to content

Form page layout ​

The shell every add and edit page uses: a card, a form contract and a footer.

Open in demo
Open in demo

Usage ​

Put a SchemaForm in the default slot and the layout does the rest: the header, the card around the form, and the form surface that gives the form its footer.

The layout provides a form surface, which is how it tells the form what shape to take. By default that surface is flat with a footer: one two-column grid, no section headings, and the Save and Cancel bar drawn by the form itself. That is why the add and edit buttons are not in this layout.

Examples ​

Keep the schema's own structure ​

structured stops the surface flattening the form, so a schema's group headings and per-field grid spans are honored. The card and the footer stay.

The flat default is right for the add and edit pages that ship, and it stays the default, so a page that says nothing gets what it always got. Without structured, a schema that declares sections would lose them silently.

A shell, not a form ​

bare drops the card and the form contract, for a page that uses this layout for its header and then renders panels that bring their own surfaces. Settings does exactly that; carding it would draw a box around three boxes.

The surface, in one table ​

PropsflatfooterUse it for
noneyesyesThe usual add or edit page.
structurednoyesA schema with sections or a deliberate grid.
barenonoA page that is a shell, not a form.

API ​

Source: src/shared/components/common/pages/FormPageLayout.vue

Props ​

PropTypeDefaultDescription
titlestring—Forwarded to the page header.
barebooleanfalseNo card, no form contract.
structuredbooleanfalseKeep the schema's sections and grid.

Emits ​

None.

Slots ​

SlotDescription
breadcrumbForwarded to the page header.
header-actionsForwarded to the page header's actions.
defaultThe form, or whatever the page is.
actionsA row under the card, for an action the form does not own, such as a download.

Note the two action slots. header-actions goes in the header; actions goes under the card. The Save and Cancel buttons belong to neither: they are the form's footer.

Accessibility ​

  • The card clips its own corners, so the footer's full-bleed rule follows the card's radius rather than squaring off its bottom.
  • The footer is inside the form element, which is what keeps its submit button wired to the form and working from the keyboard.