> For the complete documentation index, see [llms.txt](https://docs.limio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.limio.com/components/component-library/modular-checkout-components/component-checkout-form.md).

# Component: Checkout Form

The Checkout Form component is the foundation of our checkout experience, providing a powerful and flexible way to capture user input. Built for versatility, it adapts seamlessly to a wide range of scenarios, from simple data capture to complex multi-step checkouts.

It includes a library of reusable subcomponents for common fields such as text, email, address, and payment details. These pre-built elements make it fast and consistent to assemble forms, while still allowing for customisation when needed.

We recommend using the [60/40 layout](https://docs.limio.com/product/page-builder/page-builder-overview-of-key-features/configure-layout) for this component, using the left-side (60%) for the Checkout Form and the right-side (40%) of the page for [cart components](https://docs.limio.com/components/component-library/cart-components/using-cart-components-for-acquisition.md). Note that this layout is responsive and the right-side will go at the top of the page for smaller devices.

{% embed url="<https://69c2cf3a42a094f3cd354b8d-hbwumtssfk.chromatic.com/?path=/story/shop-components-checkout-checkout-form--default&full=1&shortcuts=false&singleStory=true&embed=true>" %}

## Adding a Subcomponent

To add subcomponents, you'll need the Checkout Form component. Follow these steps:

1\. Click on "Add Component".\
2\. Search for the Checkout Form component under Acquisition.\
3\. Click on the purple pencil edit button.\
4\. Select "Edit Subcomponents"

See this article for a list of the available subcomponents: [Modular Checkout Subcomponents](https://docs.limio.com/components/component-library/modular-checkout-components/modular-checkout-subcomponents-in-form.md) See this article for more information on customising your subcomponents: [Common customisations for Form subcomponents](https://docs.limio.com/components/component-library/modular-checkout-components/common-customisations-for-form-subcomponents.md)

| Prop Label                       | Type      | Default Value | Info                                                                                              |
| -------------------------------- | --------- | ------------- | ------------------------------------------------------------------------------------------------- |
| Required field label             | string    | Required      | This text will appear next to all required fields. If left blank, no indicator will be displayed. |
| Optional field label             | string    |               | This text will appear next to all optional fields. If left blank, no indicator will be displayed. |
| Submit button label              | string    | Submit        |                                                                                                   |
| Order complete URL               | string    | /complete/    | URL to redirect customer to after successful form submission                                      |
| Invalid form message             | rich text |               |                                                                                                   |
| Invalid form message font color  | color     | #856404       |                                                                                                   |
| Invalid message background color | color     | #FFF3CD       |                                                                                                   |

## Submit button

The Checkout Form adds one submit button below its subcomponents. The button is part of the Checkout Form. It is not a subcomponent, so you cannot remove it or move it in **Edit Subcomponents**. The **Submit button label** prop sets its text.

The Checkout Form has no prop that hides the submit button. The form hides the button automatically when the customer selects a payment method that shows its own button, for example PayPal, Apple Pay or Google Pay.

When the customer selects the submit button, the form does these steps:

1. It does the validation of the fields. If a field is not valid, the form stops and puts the focus on the first field that is not valid.
2. It sends the order to Limio. During this step, the button is disabled and shows a spinner.
3. If the order is successful, it sends the customer to the **Order complete URL**, with the basket id in the `basket` query parameter.
4. If the order is not successful, it shows an error message. If Limio has no specific message for the error, the form shows the **Invalid form message**.

A [custom subcomponent](https://docs.limio.com/developers/custom-components/custom-subcomponents#how-a-custom-subcomponent-works-in-the-checkout-form) can render a `button` with `type="submit"`. That button submits the Checkout Form through the same steps. The standard submit button stays on the page, so the customer sees the two buttons.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.limio.com/components/component-library/modular-checkout-components/component-checkout-form.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
