Ravi Katiyar

Video Generator Card

AI chats 103

About

This file contains the reusable VideoGeneratorCard component. It's built with shadcn/ui primitives and is fully typed with TypeScript. Props like storyboardImages, initialPrompt, onGenerate, and isLoading make it flexible for various use cases.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Video Generator Card to your project and fits it to your theme.

Code

How Video Generator Card is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import * as React from "react"

import { VideoGeneratorCard } from "@/components/ui/video-generator-card"

export default function VideoGeneratorCardDemo() {
  const [isLoading, setIsLoading] = React.useState(false);

  // Sample data for the storyboard images
  const storyboardImages = [
    {
      src: 'https://www.thiings.co/_next/image?url=https%3A%2F%2Flftz25oez4aqbxpq.public.blob.vercel-storage.com%2Fimage-7265ae2FvvY1NECu1e4sxmOs1Q6s7h.png&w=1000&q=75',
      alt: 'A person in green pants sitting with knees to chest.',
    },
    {
      src: 'https://www.thiings.co/_next/image?url=https%3A%2F%2Flftz25oez4aqbxpq.public.blob.vercel-storage.com%2Fimage-hhPaKmoyd4nBebxrwYPSULnJ8GUjow.png&w=320&q=75',
      alt: 'A person in a white dress standing against an orange background.',
    },
    {
      src: 'https://www.thiings.co/_next/image?url=https%3A%2F%2Flftz25oez4aqbxpq.public.blob.vercel-storage.com%2Fimage-faPseNwO03Gngr7lQUwgpQcs4z52Yw.png&w=1000&q=75',
      alt: 'A person in a red and white skirt stretching on an orange couch.',
    },
  ];

  const initialPrompt = "Use the storyboard uploaded to create an advertising retro short video in 30 seconds.";

  // Handler for the generate action
  const handleGenerate = (prompt: string) => {
    console.log("Generating video with prompt:", prompt);
    setIsLoading(true);

    // Simulate an API call
    setTimeout(() => {
      setIsLoading(false);
      alert("Video generation started!");
    }, 2000);
  };
  
  // Handler for the close action
  const handleClose = () => {
    alert("Close button clicked!");
  };

  return (
    <div className="flex items-center justify-center w-full h-[600px] bg-background"
      style={{
        backgroundImage: 'radial-gradient(circle at top left, hsl(var(--primary)/0.1), transparent 40%), radial-gradient(circle at bottom right, hsl(var(--primary)/0.1), transparent 40%)',
      }}>
      <VideoGeneratorCard
        storyboardImages={storyboardImages}
        initialPrompt={initialPrompt}
        isLoading={isLoading}
        onGenerate={handleGenerate}
        onClose={handleClose}
      />
    </div>
  )
}

Dependencies

More by Ravi Katiyar

View all
  • Animated Shader Hero

    Animated Shader Hero

    3.9K
  • Hero

    Hero

    3.5K
  • Circular Gallery

    Circular Gallery

    3K
  • Minimalist Hero

    Minimalist Hero

    2.8K
  • Glass Calendar

    Glass Calendar

    2.1K
  • Floating Icons Hero Section

    Floating Icons Hero Section

    2K
  • Feature Carousel

    Feature Carousel

    1.8K
  • AI Image Generator Hero

    AI Image Generator Hero

    1.5K

More in AI chats

View all
  • Agent Chat

    Agent Chat

    21
  • AI Suggestions

    AI Suggestions

    27
  • AI Actions

    AI Actions

    372
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    30
  • Aquarium Prompt

    Aquarium Prompt

    223
  • Message Parts

    Message Parts

    11
  • AI SaaS Workflow Hero

    AI SaaS Workflow Hero

    37
  • AI Chat Composer

    AI Chat Composer

    22