Alert
Basic Alerts

Alerts are essential for communicating important messages, warnings, or updates to users. In this section, you'll learn how to use basic alerts effectively to provide information and enhance the user experience.

Example code / preview
            <div class="flex flex-col gap-2">
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-primary border-primary text-white dark:border-primary">Awesome simple alert</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-secondary/70 border-secondary/70 text-slate-500 dark:border-darkmode-400 dark:bg-darkmode-400 dark:text-slate-300">Awesome simple alert</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-success border-success text-slate-900 dark:border-success">Awesome simple alert</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-warning border-warning text-slate-900 dark:border-warning">Awesome simple alert</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-pending border-pending text-white dark:border-pending">Awesome simple alert</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-danger border-danger text-white dark:border-danger">Awesome simple alert</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-dark border-dark text-white dark:bg-darkmode-800 dark:border-transparent dark:text-slate-300">Awesome simple alert</div>
</div>
        

Basic alerts are a fundamental element of user interface design, serving as a means to communicate important messages clearly and effectively. Whether you're building a website or an application, incorporating basic alerts can greatly improve the user experience by providing timely information and feedback.

Icon Alerts

Icon alerts combine informative messages with easily recognizable icons to convey important information to users effectively. This section will guide you on how to use icon alerts in your project.

Example code / preview
            <div class="flex flex-col gap-2">
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-primary border-primary text-white dark:border-primary flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-secondary/70 border-secondary/70 text-slate-500 dark:border-darkmode-400 dark:bg-darkmode-400 dark:text-slate-300 flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-success border-success text-slate-900 dark:border-success flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-warning border-warning text-slate-900 dark:border-warning flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-pending border-pending text-white dark:border-pending flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-danger border-danger text-white dark:border-danger flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-dark border-dark text-white dark:bg-darkmode-800 dark:border-transparent dark:text-slate-300 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
</div>
        

Icon alerts are a valuable tool for enhancing user interaction by providing clear and visually appealing messages. By following the steps above, you can easily integrate icon alerts into your project and effectively communicate important information to your users.

Additional Content Alerts

Additional content alerts allow you to convey more information to users by including extra elements within the alert, such as icons, labels, or additional text. This section provides guidance on how to use additional content alerts effectively.

Example code / preview
            <div class="flex flex-col gap-2">
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-primary border-primary text-white dark:border-primary">
        <div class="flex items-center">
            <div class="text-lg font-medium">
                Awesome alert with additional info
            </div>
            <div class="ml-auto rounded-md bg-white px-1 text-xs text-slate-700">
                New
            </div>
        </div>
        <div class="mt-3">
            Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum
            has been the industry's standard dummy text
            ever since the 1500s.
        </div>
    </div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-secondary/70 border-secondary/70 text-slate-500 dark:border-darkmode-400 dark:bg-darkmode-400 dark:text-slate-300">
        <div class="flex items-center">
            <div class="text-lg font-medium">
                Awesome alert with additional info
            </div>
            <div class="ml-auto rounded-md bg-slate-500 px-1 text-xs text-white">
                New
            </div>
        </div>
        <div class="mt-3">
            Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum
            has been the industry's standard dummy text
            ever since the 1500s.
        </div>
    </div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-success border-success text-slate-900 dark:border-success">
        <div class="flex items-center">
            <div class="text-lg font-medium">
                Awesome alert with additional info
            </div>
            <div class="ml-auto rounded-md bg-white px-1 text-xs text-slate-700">
                New
            </div>
        </div>
        <div class="mt-3">
            Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum
            has been the industry's standard dummy text
            ever since the 1500s.
        </div>
    </div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-warning border-warning text-slate-900 dark:border-warning">
        <div class="flex items-center">
            <div class="text-lg font-medium">
                Awesome alert with additional info
            </div>
            <div class="ml-auto rounded-md bg-white px-1 text-xs text-slate-700">
                New
            </div>
        </div>
        <div class="mt-3">
            Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum
            has been the industry's standard dummy text
            ever since the 1500s.
        </div>
    </div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-pending border-pending text-white dark:border-pending">
        <div class="flex items-center">
            <div class="text-lg font-medium">
                Awesome alert with additional info
            </div>
            <div class="ml-auto rounded-md bg-white px-1 text-xs text-slate-700">
                New
            </div>
        </div>
        <div class="mt-3">
            Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum
            has been the industry's standard dummy text
            ever since the 1500s.
        </div>
    </div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-danger border-danger text-white dark:border-danger">
        <div class="flex items-center">
            <div class="text-lg font-medium">
                Awesome alert with additional info
            </div>
            <div class="ml-auto rounded-md bg-white px-1 text-xs text-slate-700">
                New
            </div>
        </div>
        <div class="mt-3">
            Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum
            has been the industry's standard dummy text
            ever since the 1500s.
        </div>
    </div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-dark border-dark text-white dark:bg-darkmode-800 dark:border-transparent dark:text-slate-300">
        <div class="flex items-center">
            <div class="text-lg font-medium">
                Awesome alert with additional info
            </div>
            <div class="ml-auto rounded-md bg-slate-500 px-1 text-xs text-white">
                New
            </div>
        </div>
        <div class="mt-3">
            Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum
            has been the industry's standard dummy text
            ever since the 1500s.
        </div>
    </div>
</div>
        

Additional content alerts are a valuable tool for delivering richer information to users while maintaining a clean and organized design. By following the steps above, you can easily integrate additional content alerts into your project and enhance your communication with users.

Icon & Dismiss Alerts

Icon & Dismiss Alerts combine icons with dismiss functionality, allowing you to display important messages to users and give them the option to close the alert when they've read it. This section provides guidance on how to use these alerts effectively.

Example code / preview
            <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-primary border-primary text-white dark:border-primary mb-2 flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 text-white"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 bg-secondary/70 border-secondary/70 text-slate-500 dark:border-darkmode-400 dark:bg-darkmode-400 dark:text-slate-300 mb-2 flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 bg-success border-success text-slate-900 dark:border-success mb-2 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 bg-warning border-warning text-slate-900 dark:border-warning mb-2 flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 bg-pending border-pending text-white dark:border-pending mb-2 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 bg-danger border-danger text-white dark:border-danger mb-2 flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 text-white"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 bg-dark border-dark text-white dark:bg-darkmode-800 dark:border-transparent dark:text-slate-300 mb-2 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 text-white"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
        

Icon & Dismiss Alerts are a user-friendly way to provide information and allow users to manage their notifications. By following the steps above, you can seamlessly integrate these alerts into your project and improve user interaction and communication.

Outline Alerts

Outline Alerts provide a clean and minimalistic way to display important messages with outlined borders. This section provides guidance on how to use these alerts effectively to convey information to your users.

Example code / preview
            <div role="alert" class="alert relative border rounded-md px-5 py-4 border-primary text-primary dark:border-primary mb-2 flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 border-secondary text-slate-500 dark:border-darkmode-100/40 dark:text-slate-300 mb-2 flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 border-success text-success dark:border-success dark:border-success mb-2 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 border-warning text-warning dark:border-warning mb-2 flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 border-pending text-pending dark:border-pending mb-2 flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 border-danger text-danger dark:border-danger mb-2 flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
<div role="alert" class="alert relative border rounded-md px-5 py-4 border-dark text-dark dark:border-darkmode-800 dark:text-slate-300 mb-2 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
    Awesome alert with icon
    <button data-tw-merge data-tw-dismiss="alert" type="button" aria-label="Close" class="text-slate-800 py-2 px-3 absolute right-0 my-auto mr-2 btn-close"><i data-tw-merge data-lucide="x" class="stroke-[1] w-5 h-5 h-4 w-4 h-4 w-4"></i></button>
</div>
        

Outline Alerts offer a sleek and effective way to communicate essential information to users while maintaining a clean design. By following the steps above, you can seamlessly integrate these alerts into your project and enhance the user experience.

Soft Color Alerts

Soft Color Alerts provide a visually pleasing and gentle way to convey important messages with soft color tones. This section provides guidance on how to use these alerts effectively to enhance the user experience.

Example code / preview
            <div class="flex flex-col gap-2">
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-primary border-primary bg-opacity-20 border-opacity-5 text-primary dark:border-opacity-100 dark:bg-opacity-20 dark:border-primary flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-slate-300 border-secondary bg-opacity-10 text-slate-500 dark:bg-darkmode-100/20 dark:border-darkmode-100/30 dark:text-slate-300 flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-success border-success bg-opacity-20 border-opacity-5 text-success dark:border-success dark:border-opacity-20 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-warning border-warning bg-opacity-20 border-opacity-5 text-warning dark:border-warning dark:border-opacity-20 flex items-center"><i data-tw-merge data-lucide="alert-circle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-pending border-pending bg-opacity-20 border-opacity-5 text-pending dark:border-pending dark:border-opacity-20 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-danger border-danger bg-opacity-20 border-opacity-5 text-danger dark:border-danger dark:border-opacity-20 flex items-center"><i data-tw-merge data-lucide="alert-octagon" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
    <div role="alert" class="alert relative border rounded-md px-5 py-4 bg-dark border-dark bg-opacity-20 border-opacity-5 text-dark dark:bg-darkmode-800/30 dark:border-darkmode-800/60 dark:text-slate-300 flex items-center"><i data-tw-merge data-lucide="alert-triangle" class="stroke-[1] w-5 h-5 mr-2 h-6 w-6 mr-2 h-6 w-6"></i>
        Awesome alert with icon</div>
</div>
        

Soft Color Alerts offer a subtle and pleasing way to communicate essential information to users while maintaining a gentle aesthetic. By following the steps above, you can seamlessly integrate these alerts into your project and create a visually appealing user experience.

Component API

In this section, you will find detailed information about the available props, classes, and options that can be used with the component. Understanding these properties is essential for customizing and configuring the component to suit your specific requirements.

Below is a list of props that can be passed to the component:

Alert
Prop Type Description
`dismissible` `boolean` Indicates if the alert can be dismissed
`variant` `Variant` Variant of the alert style
`onShow` `() => {}` Callback when the alert is shown
`onShown` `() => {}` Callback after the alert is shown
`onHide` `() => {}` Callback when the alert is about to hide
`onHidden` `() => {}` Callback after the alert is hidden
Alert.DismissButton
Prop Type Description
`as` `string` HTML element type for the dismiss button (default is "button" or "a")