Skip to content

Sensible defaults

The DX layer applies a small set of sensible defaults to keep your form definitions concise:

DefaultBehavior
Auto-labelIf you don’t provide label, the engine derives one from path (e.g. user.firstNameFirst Name).
Auto-placeholderIf you don’t provide placeholder, the engine uses path as a placeholder.
Auto-submit-buttonIf your formDef has no gui.actions.button/submitButton, the engine appends a default submit button.
Auto-stackIf your formDef has multiple top-level items and no top-level layout, the engine wraps them in a vertical flex.

Each default can be turned off, either globally (via formConfig) or scoped (via a selector).

const formConfig = {
suppressAutomaticSubmit: true, // no auto submit button
suppressAutomaticStack: true, // no auto vertical wrap
};
const formSelectors = [
// suppress auto-labels and auto-placeholders on every input
gui.selectors.inputs({
suppressAutomaticLabels: true,
suppressAutomaticPlaceholders: true,
}),
// override that suppression for inputs tagged 'identity'
gui.selectors.tag('identity').inputs({
suppressAutomaticPlaceholders: false,
}),
];
  • Precedence — where defaults sit in the merge order.