Kavi Katiyar

Card

Cards 607

About

Alert Card A visually engaging, animated alert card to deliver

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

Code

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

Usage.tsx

// demo.tsx
import * as React from "react";
import { Bell } from "lucide-react";
import { AlertCard } from "@/components/ui/card-8";
import { Button } from "@/components/ui/button";

export default function AlertCardDemo() {
  const [isCardVisible, setIsCardVisible] = React.useState(true);

  const handleUnderstood = () => {
    console.log("User understood the alert.");
    setIsCardVisible(false);
  };
  
  const handleDismiss = () => {
    console.log("User dismissed the alert.");
    setIsCardVisible(false);
  };
  
  // A button to reset the demo and show the card again
  const handleReset = () => {
    setIsCardVisible(true);
  };

  return (
    <div className="flex h-[400px] w-full flex-col items-center justify-center gap-4">
      {!isCardVisible && (
         <Button onClick={handleReset}>Show Alert Card</Button>
      )}

      <AlertCard
        isVisible={isCardVisible}
        title="Don't miss your flight"
        description="Hi Jonathan, You have a flight today at 02:15 PM. Better to go early to avoid road traffic."
        buttonText="Okay, I Understand"
        onButtonClick={handleUnderstood}
        onDismiss={handleDismiss} // Provide dismiss handler to show the X button
        icon={<Bell className="h-6 w-6 text-destructive-foreground" />}
      />
    </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
  • Order Confirmation Card

    Order Confirmation Card

    504
  • Project Detail View

    Project Detail View

    408
  • State

    State

    393
  • Animated Card

    Animated Card

    393
  • Performance Benchmark Card

    Performance Benchmark Card

    387

More in Cards

View all
  • Statistics Card 2

    Statistics Card 2

    264
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Stats cards with links

    Stats cards with links

    39
  • The Item one

    The Item one

    3
  • Card Studio

    Card Studio

    7
  • Statistics Card 7

    Statistics Card 7

    292
  • Item

    Item

    10