Skip to content

Element

Description

Form.Element is a wrapper component for the HTML form element.

  • It ensures, users can press enter key while focusing on an input field.
  • It calls preventDefault by default.

Demos

Basic form element

Code Editor
<Form.Element onSubmit={(event) => console.log('onSubmit', event)}>
  <Layout.Card spacing="medium">
    <Field.Email />
    <Layout.ButtonRow>
      <Form.SubmitButton />
    </Layout.ButtonRow>
  </Layout.Card>
</Form.Element>