CheckoutForm
The CheckoutForm
component is a form component that allows users to fill in their details and place an order. You can use this component to build a custom checkout page.
Props
fields { title?: string, fields: CheckoutField[], type?: 'regular' | 'billing' }[]?
{ title?: string, fields: CheckoutField[], type?: 'regular' | 'billing' }[]?
An array of field groups that contain the fields that you want to display in the form. Each field object should have a fields
property that contains an array of CheckoutField
objects. You can use this prop to customize the fields that are displayed in the form.
By default, this component uses the defaultCheckoutFields
array to display the fields. You can extend this array or provide your own fields using this prop.
inputClassName string?
string?
The class name that is applied to the input elements in the form. This prop is optional, and it defaults to an empty string.
className string?
string?
The class name that is applied to the form element. This prop is optional, and it defaults to an empty string.
fallback React.ReactNode?
React.ReactNode?
A fallback component that is shown while the data is loading. This prop is optional, and it defaults to null
.
A custom component that is used to render text input elements in the form. This prop is optional, and it defaults to the TextInput
component.
A custom component that is used to render checkbox input elements in the form. This prop is optional, and it defaults to the CheckboxInput
component.
A custom component that is used to render dropdown input elements in the form. This prop is optional, and it defaults to the DropdownInput
component.
A custom component that is used to render email input elements in the form. This prop is optional, and it defaults to the TextInput
component.
A custom component that is used to render phone number input elements in the form. This prop is optional, and it defaults to the TextInput
component.
A custom component that is used to render date input elements in the form. This prop is optional, and it defaults to the DateInput
component.
A custom component that is used to render the submit button in the form. This prop is optional, and it defaults to the SubmitButton
component.
Example
Last updated