Skip to content

formbase-dev/formbase-remix-example

Repository files navigation

Formbase + Remix Example

A simple contact form example using Remix / React Router and Formbase.

What is 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.

Quick Start

  1. Clone this repository:

    git clone https://github.com/formbase-dev/formbase-remix-example.git
    cd formbase-remix-example
  2. Install dependencies:

    bun install
  3. Configure your Form ID:

    • Sign up at formbase.dev and create a form
    • Copy your Form ID
    • Open app/components/ContactForm.tsx and replace YOUR_FORM_ID with your actual Form ID
  4. Start the development server:

    bun run dev

How it Works

  1. User fills out the contact form (name, email, message)
  2. On submit, the form data is POSTed to https://formbase.dev/s/{YOUR_FORM_ID}
  3. Formbase processes the submission and sends you a notification
  4. User is redirected to a thank-you page

Project Structure

├── app/
│   ├── components/
│   │   └── ContactForm.tsx    # Form component with loading state
│   ├── routes/
│   │   ├── home.tsx           # Home page with contact form
│   │   └── thank-you.tsx      # Success page after submission
│   ├── app.css                # Tailwind CSS
│   ├── root.tsx               # Root layout
│   └── routes.ts              # Route configuration
├── public/
├── package.json
├── react-router.config.ts
└── vite.config.ts

Customization

Adding Fields

Add new input fields in ContactForm.tsx:

<div>
  <label htmlFor="phone">Phone</label>
  <input type="tel" id="phone" name="phone" />
</div>

Changing Styles

This project uses Tailwind CSS. Modify the classes on any element to change its appearance.

Tech Stack

Links

License

MIT

About

Formbase + Remix example

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published