Serafim

Alert

Component 40

About

Alert in shadcn/ui format

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

Code

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

Usage.tsx

import { Alert } from "@/components/ui/alert"
import { Button } from "@/components/ui/button"
import { CircleCheck, X } from "lucide-react"

function AlertSuccessWithAction() {
  return (
    <Alert
      layout="row"
      isNotification
      className="min-w-[400px]"
      icon={
        <CircleCheck
          className="text-emerald-500"
          size={16}
          strokeWidth={2}
          aria-hidden="true"
        />
      }
      action={
        <div className="flex items-center gap-3">
          <Button size="sm">Undo</Button>
          <Button
            variant="ghost"
            className="group -my-1.5 -me-2 size-8 shrink-0 p-0 hover:bg-transparent"
            aria-label="Close banner"
          >
            <X
              size={16}
              strokeWidth={2}
              className="opacity-60 transition-opacity group-hover:opacity-100"
              aria-hidden="true"
            />
          </Button>
        </div>
      }
    >
      <div className="flex grow items-center justify-between gap-12">
        <p className="text-sm">You've made changes!</p>
      </div>
    </Alert>
  )
}

export { AlertSuccessWithAction }

Dependencies

More by Serafim

View all
  • Spline Scene

    Spline Scene

    9.8K
  • Testimonials with Marquee

    Testimonials with Marquee

    2.4K
  • Gradient Button

    Gradient Button

    2K
  • Pixel Canvas

    Pixel Canvas

    926
  • Animated Blur Number

    Animated Blur Number

    834
  • Empty State

    Empty State

    798
  • Balloons

    Balloons

    788
  • Status Badge

    Status Badge

    693