All components

Alert with Dismiss

Alert with Dismiss is a React and Tailwind CSS feedback component from Bund UI, licensed MIT. Copy it and paste it into your project.

Bund UI MIT feedback

What it is

Alert with Dismiss is a React and Tailwind CSS feedback component from Bund UI, licensed MIT. Copy it and paste it into your project.

How to use it

Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.

Open in the catalogue

Five free copies a month. No card.

Needs

npm i lucide-react

Licence

This component comes from Bund UI and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.

Alert with Dismiss

examples/components/alert/with-dismiss/page.tsx
"use client";

import { useState } from "react";
import { CheckCircle2Icon, XIcon } from "lucide-react";

import { Alert, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";

export default function AlertWithDismiss() {
  const [show, setShow] = useState(true);

  if (!show) return null;

  return (
    <Alert className="flex items-center justify-between">
      <div className="flex gap-3">
        <CheckCircle2Icon className="mt-0.5 size-4" />
        <AlertTitle>Success! Your changes have been saved</AlertTitle>
      </div>
      <Button variant="ghost" size="icon-sm" onClick={() => setShow(false)}>
        <XIcon />
      </Button>
    </Alert>
  );
}

Similar components