Kavi Katiyar

Trip Details Card

Cards 63

About

Trip Details Card A reusable card component to display travel or booking information, featuring a header, details section, and a configurable action toolbar. It's designed with framer-motion for a subtle entry animation.

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

Code

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

Usage.tsx

import { 
  TripDetailsCard,
  type TripAction,
} from "@/components/ui/trip-details-card";
import { 
  XCircle, 
  RefreshCcw, 
  History, 
  FileText, 
  Download 
} from "lucide-react";

// Demo component to showcase the TripDetailsCard
export default function TripDetailsCardDemo() {
  
  // Define sample actions for the card's toolbar
  const tripActions: TripAction[] = [
    {
      label: "Cancel flights",
      icon: XCircle,
      variant: "ghost",
      onClick: () => alert("Cancel flights clicked!"),
      // Custom styling for destructive action
      className: "text-red-500 hover:bg-red-500/10 hover:text-red-600 dark:hover:bg-red-500/10 dark:hover:text-red-500"
    },
    {
      label: "Calculate refund",
      icon: RefreshCcw,
      variant: "ghost",
      onClick: () => alert("Calculate refund clicked!"),
    },
    {
      label: "Reschedule flights",
      icon: History,
      variant: "ghost",
      onClick: () => alert("Reschedule flights clicked!"),
    },
    {
      label: "Download invoice",
      icon: FileText,
      variant: "ghost",
      onClick: () => alert("Download invoice clicked!"),
    },
    {
      label: "Download ticket",
      icon: Download,
      variant: "ghost",
      onClick: () => alert("Download ticket clicked!"),
    },
  ];

  return (
    <div className="w-full min-h-screen bg-background flex items-center justify-center p-4">
      <TripDetailsCard
        origin="Chandigarh"
        destination="Lucknow"
        travelerName="Kavi"
        status="upcoming"
        tripId="250793635642"
        travelDate={new Date("2025-10-20T00:00:00Z")}
        actions={tripActions}
      />
    </div>
  );
}

Dependencies

More by Kavi Katiyar

View all
  • 3D Card

    3D Card

    981
  • Bento Product Features

    Bento Product Features

    831
  • Testimonial Slider

    Testimonial Slider

    716
  • Card

    Card

    608
  • Order Confirmation Card

    Order Confirmation Card

    504
  • Project Detail View

    Project Detail View

    408
  • State

    State

    393
  • Animated Card

    Animated Card

    393

More in Cards

View all
  • Stats cards with links

    Stats cards with links

    33
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Statistics Card 2

    Statistics Card 2

    264
  • Statistics Card 10

    Statistics Card 10

    263
  • Card

    Card

    17
  • Card Studio

    Card Studio

    9
  • The Item one

    The Item one

    3