Alert

Displays a callout for user attention.

Payment successful

Your payment of $29.99 has been processed. A receipt has been sent to your email address.

New feature available

We've added dark mode support. You can enable it in your account settings.

Basic

A basic alert with an icon, title, and description.

Account updated successfully

Your profile information has been saved. Changes will be reflected immediately.

Destructive

Alerts have a destructive themed variant.

Payment failed

Your payment could not be processed. Please check your payment method and try again.

Action

Use AlertAction to add a button or other action element to the alert.

Dark mode is now available

Enable it under your profile settings to get started.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::alert::*;

#[component]
pub fn AlertAnatomy() -> impl IntoView {
    view! {
        <Alert>
            <AlertTitle />
            <AlertDescription />
            <AlertAction />
        </Alert>
    }
}

API Reference

Alert

Contains the contents of the alert.

Custom Attributes
NameTypeDefaultDescription
variantString"alert"

Specifies the style of alert to display.

Implements global attributes.

AlertAction

Displays actionable inputs in the top right corner of the alert.

Implements global attributes.

AlertDescription

Contains the description of the alert.

Implements global attributes.

AlertTitle

Contains the title of the alert.

Implements global attributes.