A simple contact form example using Vue and Formbase.
Formbase is a form backend service that handles form submissions for you. No server code needed - just point your form to Formbase and receive submissions via email or webhooks.
-
Clone this repository:
git clone https://github.com/formbase-dev/formbase-vue-example.git cd formbase-vue-example -
Install dependencies:
bun install
-
Configure your Form ID:
- Sign up at formbase.dev and create a form
- Copy your Form ID
- Open
src/components/ContactForm.vueand replaceYOUR_FORM_IDwith your actual Form ID
-
Start the development server:
bun run dev
- User fills out the contact form (name, email, message)
- On submit, the form data is POSTed to
https://formbase.dev/s/{YOUR_FORM_ID} - Formbase processes the submission and sends you a notification
- User is redirected to a thank-you page
├── src/
│ ├── components/
│ │ └── ContactForm.vue # Form component with loading state
│ ├── pages/
│ │ ├── Home.vue # Home page with contact form
│ │ └── ThankYou.vue # Success page after submission
│ ├── router.ts # Vue Router configuration
│ ├── style.css # Tailwind CSS
│ ├── App.vue # Root component
│ └── main.ts # App entry point
├── index.html
├── package.json
├── tsconfig.json
└── vite.config.ts
Add new input fields in ContactForm.vue:
<div>
<label for="phone">Phone</label>
<input type="tel" id="phone" name="phone" />
</div>This project uses Tailwind CSS. Modify the classes on any element to change its appearance.
- Vue - UI framework
- Vite - Build tool
- TypeScript - Type safety
- Tailwind CSS - Styling
- Vue Router - Client-side routing
- Formbase - Form backend service
- Formbase Documentation
- Other Formbase Examples
MIT