
FORMCARRY EXAMPLES
Vue Contact Form
with only Frontend Code
A Vue contact form collects a visitor's name, email, and message, then posts it to a form endpoint with no backend code. Create your free formcarry endpoint, paste it into one of the five Vue 3 examples below, and start receiving submissions by email in about 2 minutes.
What is Vue
Vue is a popular JavaScript framework for building user interfaces. Its simplicity and scalability make it a great choice for both small and large-scale applications.
Formcarry integrates seamlessly with Vue. All examples on this page use Vue 3 with the Composition API (script setup), and the five tabs above cover fetch, JSON, file uploads, toast notifications, and server-side validation.
Before getting started
Visit the formcarry dashboard and create your form. In the Setup section of your form, copy your unique endpoint URL.
💡 Each form has its own unique endpoint URL, so make sure you use the right one, otherwise you will not receive messages.
Vue 3 contact form example with Fetch
Fetch is a native API, so there is nothing to install. The With Fetch tab above contains the full single-file component: v-model bindings for the fields, an
Copied example to clipboard 👏
handler that posts
Copied example to clipboard 👏
to your endpoint, a disabled button while sending, and an inline success or error message. Replace the endpoint URL with your own and the form is live.
Vue 3 contact form example with Axios
Prefer axios? Install it with
Copied example to clipboard 👏
and use the same component shape: the handler calls
Copied example to clipboard 👏
with your fields and branches on the response
Copied example to clipboard 👏
(200 success, 422 validation error). Axios throws for non-2xx responses, so the error message comes from
Copied example to clipboard 👏
. See the
With JSON tab for the fetch equivalent of a JSON submission.
Vue contact form FAQ
Can I make a Vue contact form without a backend?
Yes. Post the fields to a form endpoint such as formcarry with fetch or axios and you get every submission by email. You write zero server code.
How do I send an email from a Vue contact form?
Point the form at your formcarry endpoint; formcarry emails each submission to you and can send auto responses to the sender.
How do I validate a contact form in Vue 3?
Bind fields with v-model, check values in the submit handler before posting, and show inline errors. The Field Validation example above maps formcarry's server-side 422 validation errors under each field.
How do I show a success message after submitting?
Track a
Copied example to clipboard 👏
ref and swap the form for a thank-you line with
Copied example to clipboard 👏
, as every example above does, or use the
With Toast example for vue-toastification notifications.
Working in another framework? See our React contact form and Next.js contact form guides.