Twitter2.4k

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.

Installation

ng g @spartan-ng/cli:ui alert

Usage

import { HlmAlertImports } from '@spartan-ng/helm/alert';
import { NgIcon } from '@ng-icons/core';
<hlm-alert variant="default | destructive">
  <ng-icon name="lucideCircleCheck" />
  <h4 hlmAlertTitle>Heads up!</h4>
  <div hlmAlertDescription>You can add components and dependencies to your app using the cli.</div>
  <div hlmAlertAction>
    <button hlmBtn variant="outline" size="xs">Enable</button>
  </div>
</hlm-alert>

Examples

Destructive

Use variant="destructive" to create a destructive alert.

Payment failed

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

Action

Use hlmAlertAction 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.

Custom Colors

You can customize the alert colors by adding custom classes such as bg-amber-50 dark:bg-amber-950 to the hlm-alert component.

Your subscription will expire in 3 days.

Renew now to avoid service interruption or upgrade to a paid plan to continue using the service.

Helm API

HlmAlertAction

Selector: [hlmAlertAction]

HlmAlertDescription

Selector: [hlmAlertDescription]

HlmAlertTitle

Selector: [hlmAlertTitle]

HlmAlert

Selector: hlm-alert,[hlmAlert]

Inputs

PropTypeDefaultDescription
variant AlertVariants['variant'] default -
Alert Dialog Accordion