Skip to main content

Forms Declarative HTML API

The Forms Declarative HTML API allows developers to design and manage forms directly in HTML using intuitive, structured tags. It simplifies form creation by embedding validation rules, data bindings, and interactivity within HTML elements, minimizing the need for custom JavaScript.

DOM API

Property and attribute binding examples for Genesis Component syntax. Closing tag omitted.

Attributes

AttributeTypeUseExample
resourceNamestringName of the back-end resource which provides the metadata used to generate form and for submitting data<foundation-form resourceName="EVENT_COUNTERPARTY_INSERT">
readonlybooleanAllows you to enable read-only mode, which disables all input on the form and hides the Submit button.<foundation-form readonly>
hide-submit-buttonbooleanControls the visibility of the Submit button.<foundation-form hide-submit-button>
design-system-prefixstringName of the design system prefix that will be used in renderers.<foundation-form design-system-prefix="rapid">

Properties

PropertyTypeUseExample
additionalRenderersRendererEntry[]Allows you to provide a set of additional renderers used by the form.<foundation-form :additionalRenderers=${(x) => x.additionalRenderers}>
dataanyInitial data for the form.<foundation-form :data=${(x) => x.data}>
jsonSchemaJSONSchema7Instead of providing Form.resourceName you can hardcode the JSON schema on the client.<foundation-form :jsonSchema=${(x) => x.jsonSchema}>
renderersRendererEntry[]Allows you to provide the main set of renderers used by the form. If not provided, the built-in renderers are used by default.<foundation-form :renderers=${(x) => x.renderers}>
uischemaUiSchemaUI schema used to define configuration of the layout and elements in the form. Check UiSchema for possible options.<foundation-form :uischema=${(x) => x.uischema}>

Slots

SlotUse
userActionsUsing this slot enables you to override the default submit-button component.

Parts

PartUse
userActionsUsing this part enables you to change the styles for the items in the userActions slot.

Events fired

Events can be received by the emitting <rapid-layout>, or any parent element.

PartTypeUseExample
submit{ payload, errors }Emitted after the user clicks on the Submit button<foundation-form @submit="${() => ...}">
submit-success{ payload }Emitted when the form has no errors and the form has been submitted successfully.<foundation-form @submit-success="${() => ...}">
submit-failure{ payload, errors }Emitted when the form has errors after being submitted.<foundation-form @submit-failure="${() => ...}">

Events listened to

This component doesn't listen to any public API events.