import { KbqAlertModule } from '@koobiq/components/alert';Shows important information on a page. Can carry a hint, signal a status change, or indicate a problem.
<kbq-alert [alertColor]="'error'" [alertStyle]="'colored'">Something went wrong</kbq-alert>For a dynamically inserted alert, add role="alert" (or aria-live) on the host so assistive
technology announces it — see the component guide.
@Component({ selector: 'kbq-alert', exportAs: 'kbqAlert' }) class KbqAlert { readonly compact = input<boolean>(false); readonly alertStyle = input<KbqEnumValues<KbqAlertStyles>>( KbqAlertStyles.Default ); readonly alertColor = input<"error" | "warning" | "success" | "info">( KbqAlertColors.Info ); readonly closed = output<void>(); }
compactboolean Whether the alert uses the denser compact size.
alertStyleKbqEnumValues<KbqAlertStyles> Visual style — neutral default or the attention-drawing colored background.
alertColor"error" | "warning" | "success" | "info" Status of the alert. Drives the background in the colored style and auto-tints an uncolored
projected status icon to the matching color (info icons become contrast). Defaults to 'info'.
closedvoid Emitted when the projected close control is activated. The consumer is responsible for hiding the alert.
Marks the projected close control (place it on a native <button> with an accessible name).
@Directive({ selector: '[kbq-alert-close-button]', exportAs: 'kbqAlertCloseButton' }) class KbqAlertCloseButton {}
Marks a projected action control (link or button) shown in the alert's button stack.
@Directive({ selector: '[kbq-alert-control]', exportAs: 'kbqAlertControl' }) class KbqAlertControl {}
Marks the projected alert heading.
@Directive({ selector: '[kbq-alert-title]', exportAs: 'kbqAlertTitle' }) class KbqAlertTitle {}
Status conveyed by an alert. Drives the background (colored style) and the auto-tinted status icon.
enum KbqAlertColors { Error = 'error', Warning = 'warning', Success = 'success', Info = 'info' }
Visual style of an alert.
enum KbqAlertStyles { Default = 'default', Colored = 'colored' }
Default'default' Neutral background; the status is conveyed by the icon color only.
Colored'colored' Colored background matching the status — use to draw attention when a default alert gets lost on screen.