Interface defining the options for the AlertComponent.

AlertComponentOptions

Display Control:

interface AlertComponentOptions {
    visible: boolean;
    message: string;
    type?: "success" | "danger";
    duration?: number;
    onHide?: (() => void);
    textColor?: string;
    style?: object;
    renderContent?: ((options: {
        defaultContent: ReactNode;
        dimensions: {
            width: number;
            height: number;
        };
    }) => ReactNode);
    renderContainer?: ((options: {
        defaultContainer: ReactNode;
        dimensions: {
            width: number;
            height: number;
        };
    }) => ReactNode);
}

Properties

visible: boolean

Whether the alert is currently visible

message: string

Alert message text to display

type?: "success" | "danger"

Alert type determining background color (green/red)

duration?: number

Auto-hide duration in milliseconds (0 = no auto-hide)

onHide?: (() => void)

Callback when alert is hidden (manually or auto)

Styling:

textColor?: string

Color of the message text

style?: object

Custom styles for the alert container

Advanced Render Overrides:

renderContent?: ((options: {
    defaultContent: ReactNode;
    dimensions: {
        width: number;
        height: number;
    };
}) => ReactNode)

Function to wrap or replace the default alert content

renderContainer?: ((options: {
    defaultContainer: ReactNode;
    dimensions: {
        width: number;
        height: number;
    };
}) => ReactNode)

Function to wrap or replace the entire alert container