@formspark/vue-use-formspark

Vue composition API functions for Formspark
1,059 4
Install
npm install @formspark/vue-use-formspark
Latest Version:0.2.1
Vue:3
License:MIT
Last Updated:Aug 19, 2026
Links: GitHub  ·  npm
Maintainer: formspark-bjorn

Formspark logo

vue-use-formspark

Vue composition API functions for Formspark.

Installation

# NPM
npm install @formspark/vue-use-formspark

# PNPM
pnpm add @formspark/vue-use-formspark

# Yarn
yarn add @formspark/vue-use-formspark

Usage

useFormspark returns a [submit, submitting] tuple: submit posts a payload to your form and resolves with the JSON response, and submitting is a ref that is true while a submission is in flight.

<template>
  <form @submit.prevent="onSubmit">
    <textarea v-model="message" />
    <button type="submit" :disabled="submitting">Send</button>
  </form>
</template>

<script setup>
import { ref } from "vue";
import { useFormspark } from "@formspark/vue-use-formspark";

const [submit, submitting] = useFormspark({
  formId: "your-form-id",
});

const message = ref("");

const onSubmit = async () => {
  await submit({ message: message.value });
  message.value = "";
};
</script>

Note: do not confuse the action URL (e.g. https://submit-form.com/capybara) with the form ID (e.g. capybara); this package only uses the latter.

License

MIT

Related Packages

vue

The progressive JavaScript framework for building modern web UI.

588,019,132 54,801
vue
@vueuse/shared
372,738,348 22,398
@vueuse/core

Collection of essential Vue Composition Utilities

367,188,523 22,398
@vitejs/plugin-vue

The official plugin for Vue SFC support in Vite.

333,357,380 686
eslint-plugin-vue

Official ESLint plugin for Vue.js

266,364,830 4,591

Version History

Version Released Vue License
0.2.1 ^3.0.0 MIT
0.1.8 ^3.0.0 MIT
0.1.7 ^3.0.0 MIT
0.1.6 ^3.0.0 MIT
0.1.4 ^3.0.0 MIT