Guide
Components
Alert

Alert Component

A customizable React component for displaying alerts with various types, skins, and sizes.

Example Preview

Alert Example

Usage

import React from "react";
import { Alert } from "@/@core";
 
const MyComponent = () => {
  return (
    <div>
      <Alert
        type="success"
        skin="light"
        title="Success Alert"
        content="This is a success alert message."
        icon="mdi:check"
        button="OK"
        size="md"
        shape="rounded"
      />
    </div>
  );
};
 
export default MyComponent;

Props

PropTypeDescription
typestringThe type of the alert. Possible values: 'success', 'error', 'warning', 'info', 'primary', 'secondary', 'accent', 'base'.
skinstringThe skin of the alert. Possible values: 'light', 'dark'.
titleReactNode,stringThe title of the alert.
contentReactNode,stringThe content of the alert.
iconReactNode,stringThe icon to be displayed in the alert. If null, a default icon is chosen based on the alert type.
buttonReactNode,nullThe button content or element to be displayed in the alert.
sizestringThe size of the alert. Possible values: 'xs', 'sm', 'md', 'lg'.
shapestringThe shape of the alert. Possible values: 'rounded', 'square', 'circle'.
classNamestringAdditional CSS classes to be applied to the alert.

Default Props

PropDefault ValueDescription
type'success'The default type of the alert.
skin'light'The default skin of the alert.
title"Alert Title"The default title of the alert.
content"This is an alert"The default content of the alert.
iconnullThe default icon of the alert.
buttonnullThe default button of the alert.
size'sm'The default size of the alert.
shape'rounded'The default shape of the alert.
classNamenullThe default additional CSS classes for the alert.

Styling

The alert component supports various styles based on its type, skin, size, and shape. You can customize the appearance further by providing additional CSS classes.

Icons

Icons are powered by the Iconify library (opens in a new tab). You can use either string icon names or provide custom ReactNode icons.

ℹ️

Note: The Alert component is a flexible React component designed for displaying alerts or notifications in your application. It provides support for different variants, icons, and actions to suit various alert scenarios. This component is inspired by the DaisyUI (opens in a new tab) framework's design for alerts. Check it out for more awesome components.