Back to Blog
January 17, 20267 min readReplay: Generating Remix

Replay: Generating Remix Forms from Video Walkthroughs

R
Replay Team
Developer Advocates

TL;DR: Replay leverages video analysis and Gemini to automatically generate fully functional Remix forms, saving developers significant time and effort in UI development.

Stop Building Forms Manually: Replay Automates Remix Form Generation#

Form creation is a necessary evil in web development. While frameworks like Remix provide excellent tools for handling form submissions and data validation, the initial creation of the UI and corresponding code can be tedious and time-consuming. What if you could simply show the system what you want and have it generate the code for you?

Replay does just that. Unlike traditional screenshot-to-code tools, Replay uses "Behavior-Driven Reconstruction" to analyze video recordings of user interactions. This allows Replay, powered by Gemini, to understand the intent behind the user's actions and generate intelligent, functional code – in this case, fully working Remix forms.

The Problem: Manual Form Creation is Slow and Error-Prone#

Building forms involves more than just slapping some

text
<input>
elements onto the page. You need to:

  • Define the form structure (fields, labels, input types).
  • Implement client-side validation (optional but recommended).
  • Handle form submissions on the server.
  • Validate data on the server.
  • Persist data to a database.
  • Display appropriate error messages to the user.

This process is repetitive and prone to errors, especially when dealing with complex forms.

The Solution: Replay's Behavior-Driven Reconstruction#

Replay offers a revolutionary approach to form generation by using video as the source of truth. Simply record a video of yourself interacting with a similar form or sketching out the desired form behavior. Replay analyzes the video, understands the user flow, and generates the corresponding Remix code, including:

  • UI components (HTML, CSS).
  • Remix action functions for handling form submissions.
  • Server-side data validation.
  • Supabase integration for data persistence (optional).

This eliminates the need for manual coding, allowing developers to focus on more complex aspects of their applications.

How Replay Generates Remix Forms from Video#

Step 1: Record Your Form Walkthrough#

Record a video demonstrating the desired form's appearance and behavior. This could be a walkthrough of an existing form you like or a simple hand-drawn sketch brought to life on screen. The clearer the video, the better the results.

💡 Pro Tip: Speak clearly and deliberately while recording your walkthrough. Describe the purpose of each field and any specific validation rules you want to apply.

Step 2: Upload and Analyze with Replay#

Upload the video to Replay. Replay's video-to-code engine, powered by Gemini, will analyze the video, identifying the different form elements, their relationships, and the overall user flow.

Step 3: Review and Refine the Generated Code#

Replay generates Remix code that you can review and refine. This includes:

  • UI Components: HTML and CSS for the form elements.
  • Remix Action Function: The
    text
    action
    function in your Remix route that handles form submissions.
  • Data Validation: Server-side validation logic to ensure data integrity.
typescript
// Example Remix action function generated by Replay import { ActionFunction, json } from "@remix-run/node"; import { db } from "~/utils/db.server"; // Assuming Supabase integration export const action: ActionFunction = async ({ request }) => { const formData = await request.formData(); const name = formData.get("name") as string; const email = formData.get("email") as string; // Server-side validation if (!name) { return json({ errors: { name: "Name is required" } }, { status: 400 }); } if (!email || !email.includes("@")) { return json({ errors: { email: "Invalid email address" } }, { status: 400 }); } try { // Persist data to Supabase (example) await db.from("users").insert({ name, email }); return json({ success: true }); } catch (error) { console.error(error); return json({ errors: { general: "Failed to create user" } }, { status: 500 }); } };

📝 Note: The generated code might require some adjustments to fit your specific application requirements. Replay provides a solid foundation, but you'll likely need to customize it further.

Step 4: Integrate into Your Remix Application#

Copy and paste the generated code into your Remix application. You may need to adjust file paths and import statements to match your project structure.

Replay's Key Features for Remix Form Generation#

  • Multi-page Generation: Replay can handle forms that span multiple pages or steps.
  • Supabase Integration: Replay can automatically generate code for persisting form data to a Supabase database.
  • Style Injection: Replay attempts to infer the visual style of the form from the video and apply it to the generated code.
  • Product Flow Maps: Replay creates visual flow maps of the user interaction, helping you understand the form's overall structure and identify potential areas for improvement.

Replay vs. Traditional Form Building Tools#

FeatureTraditional Form BuildingScreenshot-to-CodeReplay
Input MethodManual CodingStatic ImagesVideo
Behavior AnalysisManual ImplementationLimited
Code GenerationManualBasic HTML/CSSFunctional Remix Code
Understanding of User IntentNoneNoneHigh
Supabase IntegrationManualManualAutomated
Style InferenceManualLimitedYes

⚠️ Warning: Replay is not a magic bullet. The quality of the generated code depends on the clarity of the video and the complexity of the form. You'll still need to review and refine the code to ensure it meets your specific requirements.

Benefits of Using Replay for Remix Form Generation#

  • Faster Development: Automate the tedious task of manually coding forms.
  • Reduced Errors: Minimize the risk of human error in form creation.
  • Improved Consistency: Ensure consistent form design and behavior across your application.
  • Enhanced Collaboration: Use video walkthroughs to communicate form requirements more effectively.
  • Focus on Core Functionality: Free up your time to focus on more complex aspects of your application.

Replay truly shines when dealing with complex forms involving conditional logic, dynamic fields, and intricate validation rules. Manually coding these forms can be a nightmare, but Replay simplifies the process by automatically generating the necessary code based on your video walkthrough.

typescript
// Example of client-side validation with Remix import { useForm } from "@remix-run/react"; export default function MyForm() { const { register, handleSubmit, formState: { errors } } = useForm(); const onSubmit = (data: any) => { console.log(data); }; return ( <form onSubmit={handleSubmit(onSubmit)}> <label htmlFor="name">Name:</label> <input type="text" id="name" {...register("name", { required: "Name is required" })} /> {errors.name && <span>{errors.name.message}</span>} <label htmlFor="email">Email:</label> <input type="email" id="email" {...register("email", { required: "Email is required", pattern: /^\S+@\S+$/i })} /> {errors.email && <span>{errors.email.message}</span>} <button type="submit">Submit</button> </form> ); }

Frequently Asked Questions#

Is Replay free to use?#

Replay offers a free tier with limited features. Paid plans are available for users who need more advanced functionality and higher usage limits. Check the Replay website for current pricing details.

How is Replay different from v0.dev?#

While both tools aim to accelerate UI development, Replay focuses on understanding behavior through video analysis, enabling it to generate more intelligent and functional code. v0.dev primarily uses text prompts and pre-defined components. Replay's video-to-code engine offers a more intuitive and flexible approach to UI generation.

Can I use Replay with other frameworks besides Remix?#

While this article focuses on Remix, Replay can generate code for other frameworks and libraries, including React, Vue.js, and Angular.

What kind of videos work best with Replay?#

Clear, well-lit videos with minimal background noise tend to produce the best results. Speak clearly and deliberately while demonstrating the desired form behavior.


Ready to try behavior-driven code generation? Get started with Replay - transform any video into working code in seconds.

Ready to try Replay?

Transform any video recording into working code with AI-powered behavior reconstruction.

Launch Replay Free