Banner Alert

This is a Banner Alert component.

Installation

1. Dependencies

npm install clsx tailwind-merge

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Banner Alert Code

Loading...

Copy Banner Alert Code

BannerAlert Props

NameTypeRequiredDefaultDescription
isOpenbooleanYesfalseControls whether the alert is visible.
onClose() => voidNoundefinedCallback triggered when the alert is closed.
titlestringNoundefinedTitle of the alert.
messagestringNoundefinedMessage content of the alert.
variant"success" | "warning" | "error" | "info"No"info"The variant of the alert.