Ravi Katiyar

Author Form Card

Forms 214

About

AuthorFormCard A responsive and theme-adaptive card component for creating or updating author profiles. It features an image upload area, input fields with tooltips, and integrated animations using framer-motion.

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

Code

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

Usage.tsx

import { AuthorFormCard } from "@/components/ui/author-form-card";
import { Button } from "@/components/ui/button";
import {
  Dialog,
  DialogContent,
  DialogTrigger,
} from "@/components/ui/dialog";
import { Toaster, toast } from "sonner";

export default function AuthorFormCardDemo() {
  const handleFormSubmit = (data: { name: string; title: string, imageUrl?: string }) => {
    console.log("Form submitted:", data);
    toast.success(`Author "${data.name}" has been saved!`);
    // Here you would typically close the dialog and refresh data
  };

  const handleCancel = () => {
    console.log("Form cancelled");
    toast.info("Action was cancelled.");
  };
  
  // An example of initial data for an "edit" scenario
  const existingAuthor = {
    name: "Jane Doe",
    title: "Lead Developer",
    imageUrl: "https://www.thiings.co/_next/image?url=https%3A%2F%2Flftz25oez4aqbxpq.public.blob.vercel-storage.com%2Fimage-odeolBZIWJQnTXTfGgQL4zl9csbXnl.png&w=320&q=75", // Replace with your image src
  };

  return (
    <div className="flex h-screen w-full items-center justify-center bg-background">
      <Dialog>
        <DialogTrigger asChild>
          <Button>Add New Writer</Button>
        </DialogTrigger>
        <DialogContent className="p-0 bg-transparent border-none shadow-none w-full max-w-lg">
          {/* The `AuthorFormCard` is self-contained. 
            Pass the onSubmit and onCancel handlers as props.
          */}
          <AuthorFormCard
            onSubmit={handleFormSubmit}
            onCancel={handleCancel}
            // Uncomment the line below to see the "edit" state
            // initialData={existingAuthor} 
          />
        </DialogContent>
      </Dialog>
      <Toaster position="top-right" richColors />
    </div>
  );
}

Dependencies

More by Ravi Katiyar

View all
  • Animated Shader Hero

    Animated Shader Hero

    3.7K
  • Hero

    Hero

    3.1K
  • Circular Gallery

    Circular Gallery

    2.7K
  • Minimalist Hero

    Minimalist Hero

    2.5K
  • Floating Icons Hero Section

    Floating Icons Hero Section

    1.9K
  • Glass Calendar

    Glass Calendar

    1.8K
  • Feature Carousel

    Feature Carousel

    1.7K
  • AI Image Generator Hero

    AI Image Generator Hero

    1.4K

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    47
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83