---
title: Form
description: The `Form` component should be used to wrap one or more form controls.
api_name: checkout-extensions
source_url:
html: >-
https://shopify.dev/docs/api/checkout-extensions/post-purchase/components/form
md: >-
https://shopify.dev/docs/api/checkout-extensions/post-purchase/components/form.md
---
# Form
The `Form` component should be used to wrap one or more form controls. This component provides an "implicit submit" behavior, where buyers can submit the form from any input by pressing "enter" on their keyboards. This behavior is widely expected, and should be respected as often as possible.
Unlike an HTML `form` element, this component does not support configuring the descendant fields to be submitted via HTTP automatically. Instead, you must provide an `onSubmit` callback that will perform the necessary HTTP requests in JavaScript.
##### JS
```ts
import {extend, Form, Button} from '@shopify/post-purchase-ui-extensions';
extend('Checkout::PostPurchase::Render', (root) => {
const form = root.createComponent(
Form,
{
// eslint-disable-next-line no-console
onSubmit: () => console.log('Submitted!'),
},
[root.createComponent(Button, {submit: true}, 'Submit')],
);
root.appendChild(form);
});
```
##### React
```tsx
import {render, Form, Button} from '@shopify/post-purchase-ui-extensions-react';
render('Checkout::PostPurchase::Render', () =>