FormKit: Mastering Multiple Buttons

Ruth Jul 09, 2026

FormKit is a powerful library for building forms in React, Vue, and Svelte. One of its standout features is its ability to handle multiple buttons within a form. This article explores how to use FormKit to create and manage multiple buttons in your forms, enhancing user interaction and functionality.

many different types of buttons on a white background
many different types of buttons on a white background

Before diving into multiple buttons, let's briefly understand FormKit's button handling. FormKit automatically generates a submit button for each form, but it also allows you to add custom buttons to perform various actions.

many different types of buttons in wooden boxes
many different types of buttons in wooden boxes

Adding Custom Buttons to FormKit

FormKit provides the `` component, which accepts a `buttons` prop to add custom buttons. This prop expects an array of button configurations, each defining the button's properties.

a bunch of different types of buttons and numbers on a white background with yellow accents
a bunch of different types of buttons and numbers on a white background with yellow accents

Here's a simple example of adding a custom button to a FormKit form:

```jsx console.log('Custom button clicked')}> Custom Button } > {/* Form fields go here */} ```

Button Types

Product look effective
Product look effective

FormKit supports several button types, including 'button', 'reset', 'submit', and 'link'. The 'button' type is used for custom actions, 'reset' resets the form, 'submit' submits the form, and 'link' creates a hyperlink.

You can specify the button type using the `type` prop in the button configuration:

```jsx buttons={[ { type: 'button', label: 'Custom', onClick: () => console.log('Custom button clicked') }, { type: 'reset', label: 'Reset' }, { type: 'submit', label: 'Submit' }, { type: 'link', label: 'Link', href: '/help' }, ]} ```

Button Groups

the brochure has many different types of buttons on it, including pinks and white
the brochure has many different types of buttons on it, including pinks and white

FormKit also allows you to group buttons using the `group` prop. This prop accepts an array of button configurations, wrapping them in a `

` element with the class `formkit-group`.

Here's how to create a button group:

```jsx buttons={[ { type: 'button', label: 'Button 1', onClick: () => console.log('Button 1 clicked') }, { type: 'button', label: 'Button 2', onClick: () => console.log('Button 2 clicked') }, { group: [ { type: 'button', label: 'Button 3', onClick: () => console.log('Button 3 clicked') }, { type: 'button', label: 'Button 4', onClick: () => console.log('Button 4 clicked') }, ] }, ]} ```

Managing Multiple Buttons

Free Mobile Button UI Kit for Figma
Free Mobile Button UI Kit for Figma

When working with multiple buttons, it's essential to manage their states and behaviors effectively. FormKit provides several props and events to help with this.

One useful prop is `disabled`, which accepts a boolean or a function returning a boolean. When `true`, the button is disabled. You can use this to disable buttons based on form state:

a person's hand holding several buttons in front of many other types of buttons
a person's hand holding several buttons in front of many other types of buttons
UI Kit buttons
UI Kit buttons
Button group components for Figma — Frames X
Button group components for Figma — Frames X
Buttons Antique Buttons Variety, Metallic Button Designs, Assorted Metal And Gemstone Buttons, Collection Of Vintage Metal Buttons, Hardware Buttons, Vintage Buttons 20mm, Metal Button Design Ideas, Zamak Buttons For Clothing, Metal Button Design
Buttons Antique Buttons Variety, Metallic Button Designs, Assorted Metal And Gemstone Buttons, Collection Of Vintage Metal Buttons, Hardware Buttons, Vintage Buttons 20mm, Metal Button Design Ideas, Zamak Buttons For Clothing, Metal Button Design
many different types of buttons on a white surface
many different types of buttons on a white surface
꒰ 💌 ꒱
꒰ 💌 ꒱
several different types of buttons on a white background
several different types of buttons on a white background
FRC (30pcs) Funcy Button school Theme 2 hole
FRC (30pcs) Funcy Button school Theme 2 hole
many different types of buttons on a white background
many different types of buttons on a white background
many different types of buttons on a white background
many different types of buttons on a white background
Assortment of vintage buttons
Assortment of vintage buttons
Treefort Buttons
Treefort Buttons
the buttons are clearly visible for all of us to see
the buttons are clearly visible for all of us to see
many different colored buttons on a white surface
many different colored buttons on a white surface
Vintage Button Color Chart, Vintage Button Material Guide, Vintage Button Catalog, Button Graphic Design, Milward Carded Buttons, Red Button Graphic, Retro Button Packaging, Vintage Control Panel Buttons, Hemline Button Sizes
Vintage Button Color Chart, Vintage Button Material Guide, Vintage Button Catalog, Button Graphic Design, Milward Carded Buttons, Red Button Graphic, Retro Button Packaging, Vintage Control Panel Buttons, Hemline Button Sizes
Lot schwarze Vintage und moderne Knöpfe 300 + Stück gemischte Größen und Stile
Lot schwarze Vintage und moderne Knöpfe 300 + Stück gemischte Größen und Stile
Elegant Button Layout!💡 |
Elegant Button Layout!💡 |
16 Stock-Fotos und hochauflösende Bilder zu Casein Formaldehyde
16 Stock-Fotos und hochauflösende Bilder zu Casein Formaldehyde
many different colored buttons on a blue and white checkered tablecloth
many different colored buttons on a blue and white checkered tablecloth
Download premium image of Editable cute clothes button design element set by Techi about buttons, star, clothes, sewing, and heart 15269335
Download premium image of Editable cute clothes button design element set by Techi about buttons, star, clothes, sewing, and heart 15269335

```jsx disabled={form.values.name === ''} ```

Button Events

FormKit dispatches several events related to buttons, such as `formkit:submit` and `formkit:reset`. You can listen to these events to perform actions when a button is clicked:

```jsx onFormkitSubmit={(event) => { event.preventDefault(); console.log('Form submitted'); }} ```

Button Validation

FormKit also provides validation options for buttons. You can use the `validation` prop to add validation rules to buttons, ensuring that only valid forms can be submitted or reset.

Here's how to add a required validation rule to a submit button:

```jsx buttons={[ { type: 'submit', label: 'Submit', validation: 'required' }, ]} ```

In conclusion, FormKit's handling of multiple buttons offers a flexible and powerful way to enhance user interaction in your forms. By leveraging its button props, events, and validation options, you can create intuitive and functional forms in React, Vue, and Svelte.

Now that you've explored FormKit's multiple button functionality, it's time to put these concepts into practice and elevate your form-building skills. Happy coding!