Deepseek ArtifactsDeepseek Artifacts

Flow Builder Page Creation

4.0
en
Web Development
flow builder
drag and drop
user interface
web development
interactive design

Prompt

I want a page where the user can build flows like he can drag and drop cards and parallelly connect those, it's like a flow builder page where user can create flows

Generated Result

import React, { useState } from 'react';
import './App.css';

const App = () => {
  const [cards, setCards] = useState([]);
  const [connections, setConnections] = useState([]);

  const handleDragStart = (e, id) => {
    e.dataTransfer.setData('text/plain', id);
  };

  const handleDrop = (e) => {
    e.preventDefault();
    const id = e.dataTransfer.getData('text');
    const rect = e.target.getBoundingClientRect();
    const x = e.clientX - rect.left;
    const y = e.clientY - rect.top;
    setCards([...cards, { id, x, y }]);
  };

  const handleConnect = (from, to) => {
    setConnections([...connections, { from, to }]);
  };

  return (
    <div className="App">
      <div className="flow-builder" onDrop={handleDrop} onDragOver={(e) => e.preventDefault()}>
        {cards.map((card) => (
          <div
            key={card.id}
            className="card"
            style={{ left: card.x, top: card.y }}
            draggable
            onDragStart={(e) => handleDragStart(e, card.id)}
          >
            Card {card.id}
          </div>
        ))}
        {connections.map((conn, index) => (
          <div key={index} className="connection" style={{ left: conn.from.x, top: conn.from.y }} />
        ))}
      </div>
      <div className="toolbar">
        <button onClick={() => handleConnect(cards[0], cards[1])}>Connect</button>
      </div>
    </div>
  );
};

export default App;

More Recommendations

View All

Build ChatGPT-Like Web Interface

4.0
Software Development
en
AI Integration
Full-Stack Development
ChatGPT
UI Design
Backend Orchestration
You are a professional full-stack developer AI with deep experience in building AI-integrated UIs, backend orchestration, and vector memory systems. I want you to build a **web-based ChatGPT-like int...

Flutter 产品列表页

4.0
编程开发
en
Flutter
Dart
产品列表
class ProductListPage extends StatefulWidget { final bool useArabic; const ProductListPage({super.key, this.useArabic = false}); @override State<ProductListPage> createState() => _ProductLis...

Flutter产品列表页

4.0
编程开发
en
Flutter
产品列表
Widget
class ProductListPage extends StatefulWidget { final bool useArabic; const ProductListPage({super.key, this.useArabic = false}); @override State<ProductListPage> createState() => _ProductLis...

Build XO App with AI

4.0
Programming
en
Tic Tac Toe
AI Game
JavaScript
create a complete XO (Tic Tac Toe) app with AI opponent: "Build a modern, fully-featured Tic Tac Toe (XO) app that includes: A clean, user-friendly interface optimized for mobile, tablet, and web. ...

Generate YouTube Subscribers

4.0
Technology
en
YouTube
Subscribers
App
Make an app let generate YouTube subscribers and and comments by enter your username after that the says how many subscribers and like do you want so you type the amount of likes and subscribers , so ...

YouTube Subscribers App

4.0
Technology
en
YouTube
Subscribers
App
Make an app let generate YouTube subscribers and and comments by enter your username after that the says how many subscribers and like do you want so you type the amount of likes and subscribers , so ...