Remix
Learn how to integrate your Formbox form with Remix.
What is Remix?
Remix is a full stack web framework that lets you focus on the user interface and work back through web standards to deliver a fast, slick, and resilient user experience.
Prerequisites
Before you begin, you’ll need to have a Formbox form. If you don’t have one yet, you can create a new form by following the steps in the Introduction guide. Once you have your form, make a note of the form’s endpoint url in the setup tab of your form page, as you’ll need it later.
Creating a new Remix project
To get up and running quickly, we will follow the official Remix Quick Start guide to create a new Remix project. In your terminal, run the following command:
After the prompts, create-remix will create a folder with your project name and install the required dependencies.
Go to the new directory for the new website:
Start the development server:
Open your browser and navigate to http://localhost:5174
. You should see a new Remix application running.
Adding your Formbox form to your Remix project
Now that we have a new Remix project set up, let’s add our Formbox form to it.
For styling purposes, we’ll use Tailwind CSS. You can learn how to add Tailwind CSS to your project by following the Remix installation guide.
Once you have Tailwind CSS set up, let’s add our form.
Open up the _index.tsx
file within the root of the app/routes
directory and replace everything in the file with the following code block:
Paste the form endpoint url you copied from Formbox into your form’s action
attribute as shown in the code block above.
Save the file and navigate to http://localhost:5174
in your browser. You should see a form that you can fill out and submit.
And that’s it! Now after filling out and submitting the form you should see the default submission success page displayed.