Alert Showcase

Component Documentation

Component Name

Alert

Builder Function Name

create_alert_manager

Description

Manages display of alerts, including auto-delete and optional callbacks

Use like example

Config

PropertyTypeDefaultDescription
alertsarray

initial list of alerts

is_small_screenboolean

false

whether the layout adjusts for smaller screens

x_colorstring

var(--g7-t)

color for the x dismiss icon

border_radiusnumber

1

rem-based border radius for the alert

success_icon_colorstring

var(--success-t)

color for the success check icon

error_icon_colorstring

var(--error-t)

color for the error x icon

on_alert_addedfunction

callback triggered each time a new alert is created

Methods

MethodDescriptionParametersReturns
add_alert

adds a new alert, auto-assigns an id, and starts or restarts the auto-delete timer

header: string

message: string

icon: string

void
delete_alert

removes a specific alert by id; also clears the auto-delete interval if no alerts remain

id: string

void

Returned Properties

PropertyTypeDescription
intervalany

reference to the auto-delete setinterval, or null if inactive

alertsarray

current array of alerts being tracked

is_small_screenboolean

reflects if the layout is set to small screen mode

x_colorstring

color for the x dismiss icon

border_radiusnumber

rem-based border radius for the alert

success_icon_colorstring

color for the success check icon

error_icon_colorstring

color for the error x icon

icon
Sponsored byContibase