Back to Blog
January 17, 20268 min readReplay: Turn a

Replay: Turn a Dribbble Shot into Working SolidJS Code

R
Replay Team
Developer Advocates

TL;DR: Replay uses behavior-driven reconstruction to transform a video recording of a Dribbble design into fully functional SolidJS code, complete with styling and user interactions.

The gap between design inspiration and functional code can feel like a chasm. You see a stunning design on Dribbble, envision it as a core part of your application, but the path to implementation is paved with tedious, error-prone manual coding. Screenshot-to-code tools offer a partial solution, but they often fall short when it comes to capturing the behavior and nuances of a dynamic UI.

That's where Replay comes in. Replay leverages the power of Gemini to analyze video recordings of user interfaces and reconstruct them into working code. Unlike tools that rely on static images, Replay understands the intent behind user actions, enabling it to generate not just the visual appearance, but also the underlying logic and interactions. In this article, we'll demonstrate how Replay can turn a Dribbble shot into functional SolidJS code, focusing on the practical steps and highlighting the key advantages of behavior-driven reconstruction.

From Dribbble Inspiration to SolidJS Reality#

Imagine finding a captivating design on Dribbble – a sleek dashboard, an interactive chart, or a unique animation. Instead of painstakingly dissecting the design and manually coding each element, you can record a short video of the design in action and let Replay handle the heavy lifting.

Here's how Replay makes this process seamless:

  1. Record the Design: Capture a video of the Dribbble design, focusing on the key interactions and visual elements you want to replicate. Make sure the video clearly shows the different states and transitions of the UI.
  2. Upload to Replay: Upload the video to the Replay platform.
  3. Reconstruction: Replay analyzes the video, identifies UI components, understands user interactions, and generates clean, functional SolidJS code.
  4. Refine and Integrate: Review the generated code, make necessary adjustments, and integrate it into your existing project.

Understanding Behavior-Driven Reconstruction#

Replay's core strength lies in its "Behavior-Driven Reconstruction" approach. This means that instead of simply interpreting static images, Replay analyzes the dynamic behavior captured in the video. This allows it to understand:

  • User Interactions: How elements respond to clicks, hovers, and other events.
  • State Changes: How the UI updates based on user input or data changes.
  • Animations and Transitions: The visual effects that bring the UI to life.

This behavioral understanding is crucial for generating code that is not only visually accurate but also functionally correct.

The Limitations of Screenshot-to-Code#

Screenshot-to-code tools can be helpful for generating basic UI layouts, but they often struggle with dynamic elements and complex interactions.

FeatureScreenshot-to-CodeReplay
Input TypeStatic ImagesVideo Recordings
Behavior Analysis
Dynamic UI SupportLimitedExcellent
Code QualityOften Requires Manual RefinementCleaner, More Functional
Understanding User Intent
Multi-Page Support

Step-by-Step: Recreating a Dribbble Design with Replay#

Let's walk through a practical example of using Replay to recreate a Dribbble design in SolidJS. We'll focus on a hypothetical interactive chart component.

Step 1: Recording the Dribbble Design#

Find a Dribbble shot that features an interactive chart. Record a video that shows:

  • The initial state of the chart.
  • How the chart responds to user interactions (e.g., hovering over data points, zooming, filtering).
  • Any animations or transitions.

The clearer the video, the better Replay will be able to understand the design's behavior.

Step 2: Uploading and Processing the Video#

Upload the recorded video to the Replay platform. Replay will begin analyzing the video and reconstructing the UI. This process can take a few minutes, depending on the complexity of the design.

Step 3: Reviewing the Generated SolidJS Code#

Once the reconstruction is complete, Replay will present you with the generated SolidJS code. Here's an example of what the code might look like for a simple interactive chart component:

typescript
// SolidJS Component generated by Replay import { createSignal, onMount } from 'solid-js'; import './ChartComponent.css'; // Styling generated by Replay interface ChartDataPoint { label: string; value: number; } const ChartComponent = () => { const [data, setData] = createSignal<ChartDataPoint[]>([ { label: 'Jan', value: 10 }, { label: 'Feb', value: 20 }, { label: 'Mar', value: 15 }, // ... more data points ]); const [hoveredPoint, setHoveredPoint] = createSignal<ChartDataPoint | null>(null); const handlePointHover = (point: ChartDataPoint) => { setHoveredPoint(point); }; return ( <div class="chart-container"> {data().map((point) => ( <div class="chart-bar" style={{ height: `${point.value * 5}px` }} onMouseEnter={() => handlePointHover(point)} onMouseLeave={() => setHoveredPoint(null)} > {point.label} </div> ))} {hoveredPoint() && ( <div class="tooltip"> {hoveredPoint().label}: {hoveredPoint().value} </div> )} </div> ); }; export default ChartComponent;

💡 Pro Tip: Replay often generates CSS files alongside the JavaScript code. Review these CSS files to ensure the styling matches the original Dribbble design. You can then adjust the CSS to fine-tune the appearance.

Step 4: Integrating and Customizing the Code#

The generated code provides a solid foundation, but you'll likely need to customize it to fit your specific needs. This might involve:

  • Connecting the component to your data source.
  • Adding more complex interactions.
  • Adjusting the styling to match your application's design system.

Replay's generated code is designed to be easily integrated into existing SolidJS projects.

Replay Features in Action#

Replay offers several key features that streamline the design-to-code workflow:

  • Multi-Page Generation: Replay can handle videos that show multiple pages or views within an application, generating code for each page.
  • Supabase Integration: Seamlessly integrate with Supabase for data storage and authentication.
  • Style Injection: Replay attempts to capture and replicate the original styling from the video, saving you time on manual CSS coding.
  • Product Flow Maps: Automatically generate flow maps to visualize the user journey and interactions within the reconstructed application.

Benefits of Using Replay#

  • Faster Development: Significantly reduce the time it takes to translate designs into working code.
  • Improved Accuracy: Capture the nuances of dynamic UIs that are often missed by screenshot-to-code tools.
  • Enhanced Collaboration: Facilitate communication between designers and developers by providing a clear, functional representation of the design intent.
  • Reduced Errors: Minimize the risk of errors associated with manual coding.

⚠️ Warning: While Replay significantly accelerates the development process, it's important to remember that the generated code may require some manual refinement and customization. Treat it as a starting point, not a final product.

Advanced Use Cases#

Beyond simple UI reconstruction, Replay can be used for more advanced scenarios:

  • Prototyping: Quickly create interactive prototypes from video recordings of design mockups.
  • Reverse Engineering: Analyze existing applications to understand their UI structure and behavior.
  • UI Testing: Generate test cases based on video recordings of user interactions.

Replay vs. the Competition#

How does Replay stack up against other code generation tools?

Featurev0.devTeleportHQReplay
Input SourceText PromptsFigma/SketchVideo Recordings
Code QualityGoodModerateVery Good
Behavior AnalysisLimitedLimitedExcellent
Target AudienceGeneral PurposeWeb DesignersDevelopers Focused on Dynamic UIs
Framework SupportReactReact, Vue, AngularReact, SolidJS, More Coming
Learning CurveLowModerateModerate

📝 Note: The best tool for your needs will depend on your specific requirements and workflow. Replay excels when you need to capture and replicate the behavior of dynamic UIs.

Frequently Asked Questions#

Is Replay free to use?#

Replay offers a free tier with limited usage. Paid plans are available for higher usage and access to advanced features. Check the Replay website for the most up-to-date pricing information.

How is Replay different from v0.dev?#

v0.dev generates code based on text prompts, while Replay generates code based on video recordings. Replay excels at capturing the behavior and nuances of dynamic UIs, which is difficult to achieve with text prompts alone.

What frameworks does Replay support?#

Currently, Replay supports React and SolidJS, with plans to add support for other popular frameworks in the future.

Can Replay handle complex animations?#

Replay can capture and replicate many types of animations, but complex or highly customized animations may require manual adjustments to the generated code.

How accurate is the generated code?#

The accuracy of the generated code depends on the quality of the video recording and the complexity of the design. In general, Replay produces high-quality code that requires minimal manual refinement.


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