FormKit: Custom Submit Button

Ruth Jul 09, 2026

FormKit, a powerful and flexible form library for Vue.js, offers a wide range of customization options, including the ability to create custom submit buttons. By default, FormKit uses the standard HTML submit button, but you can replace it with a custom one to match your application's design and functionality. Let's delve into creating a custom submit button in FormKit.

Top 10 Must-Known Web Design Trends and Examples for 2019
Top 10 Must-Known Web Design Trends and Examples for 2019

Before we dive into creating a custom submit button, let's ensure you have a basic understanding of FormKit. If you're new to FormKit, it's a form library that simplifies form creation and validation in Vue.js applications. It provides a simple and intuitive API for building forms, handling validation, and managing form state.

all my buttons i made :3
all my buttons i made :3

Creating a Custom Submit Button

FormKit allows you to replace the default submit button with a custom one using the #submit slot. The #submit slot is a special slot provided by FormKit that you can use to insert your custom submit button component.

Show a button to submit
Show a button to submit

To create a custom submit button, you'll need to create a new Vue component and use the #submit slot to insert your button. Here's a basic example of a custom submit button component:

Basic Custom Submit Button

a black and white photo of a button
a black and white photo of a button

First, let's create a simple custom submit button component. In your Vue app, create a new component, e.g., CustomSubmitButton.vue:

```vue ```

In this example, we've created a simple button with the text "Submit". You can customize this button to match your application's design by adding CSS styles or using a UI library like Bootstrap or Vuetify.

an email form that is being displayed on a computer screen with the message'add a sublime - domain '
an email form that is being displayed on a computer screen with the message'add a sublime - domain '

Using the Custom Submit Button in FormKit

Now that you've created your custom submit button component, you can use it in your FormKit form. To do this, you'll need to use the #submit slot and provide your component as the slot's content. Here's an example:

```vue ```

a blue button with the words build my website on it
a blue button with the words build my website on it

In this example, we've used the submit-attrs prop to specify that the custom submit button component should be used. The is prop is used to provide the component name, in this case, CustomSubmitButton.

Customizing the Submit Button's Behavior

an image of a web page with the words simplify your forms on it
an image of a web page with the words simplify your forms on it
form builder
form builder
ui buttons
ui buttons
How to Create Forms in monday work management | TechRepublic
How to Create Forms in monday work management | TechRepublic
Button - Shashank HN
Button - Shashank HN
Vueform Builder - Drag And Drop Form Builder for Vue.js
Vueform Builder - Drag And Drop Form Builder for Vue.js
six screens showing the different types of user's name and address options for their website
six screens showing the different types of user's name and address options for their website
the email buttons are shown in two different colors and font options for each button, which is
the email buttons are shown in two different colors and font options for each button, which is
Buttons on the web: placement and order
Buttons on the web: placement and order
Farrel Putra (@farrelput) on X
Farrel Putra (@farrelput) on X
a man sitting in front of a computer keyboard with the caption beginners guide to u - buttons
a man sitting in front of a computer keyboard with the caption beginners guide to u - buttons
Registration From
Registration From
SCREENSHOT
SCREENSHOT
an image of a website page with the settings displayed
an image of a website page with the settings displayed
an image of various car symbols on a black and red background, including the start button
an image of various car symbols on a black and red background, including the start button
How to Create a Circular Progress Button | Codrops
How to Create a Circular Progress Button | Codrops
Femtanyl Pins, Osc Pin Template, Button Templates, Button Maker Template, Button Template, Pin Sheet, Pin Maker Template, Bfdi Pins Template, Button Pin Design Template
Femtanyl Pins, Osc Pin Template, Button Templates, Button Maker Template, Button Template, Pin Sheet, Pin Maker Template, Bfdi Pins Template, Button Pin Design Template
How to add a Custom Pin it Button to Your Blog Images
How to add a Custom Pin it Button to Your Blog Images
Typeform - Consent Permissions
Typeform - Consent Permissions
the diagram shows how to measure an object
the diagram shows how to measure an object

FormKit also allows you to customize the submit button's behavior, such as changing the submit label or disabling the button. You can do this using the submit-label and disabled props, respectively.

For example, to change the submit button's label to "Save" and disable it when the form is invalid, you can use the following code:

Changing the Submit Label

To change the submit button's label, you can use the submit-label prop. Here's an example:

```vue ```

In this example, we've used the submit-label prop to bind the submit label to a data property, submitLabel. You can change the value of submitLabel to update the submit button's label.

Disabling the Submit Button

To disable the submit button when the form is invalid, you can use the disabled prop and bind it to the form's isValid property. Here's an example:

```vue ```

In this example, we've used the disabled prop to bind the button's disabled state to the inverse of the form's isValid property. We've also added a @blur event listener to the form to validate the form when a field loses focus.

In conclusion, creating a custom submit button in FormKit is a straightforward process that allows you to enhance the user experience and match your application's design. By using the #submit slot and customizing the button's behavior, you can create a unique and engaging form submission experience for your users. Happy coding!