import { KbqAlertModule } from '@koobiq/components/alert';

KbqAlert

componentСкопировать ссылку на KbqAlert

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>();
}
compactinputСкопировать ссылку на compactboolean

Whether the alert uses the denser compact size.

alertStyleinputСкопировать ссылку на alertStyleKbqEnumValues<KbqAlertStyles>

Visual style — neutral default or the attention-drawing colored background.

alertColorinputСкопировать ссылку на 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'.

closedoutputСкопировать ссылку на closedvoid

Emitted when the projected close control is activated. The consumer is responsible for hiding the alert.

KbqAlertCloseButton

directiveСкопировать ссылку на KbqAlertCloseButton

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 {}

KbqAlertControl

directiveСкопировать ссылку на KbqAlertControl

Marks a projected action control (link or button) shown in the alert's button stack.

@Directive({ selector: '[kbq-alert-control]', exportAs: 'kbqAlertControl' })
class KbqAlertControl {}

KbqAlertTitle

directiveСкопировать ссылку на KbqAlertTitle

Marks the projected alert heading.

@Directive({ selector: '[kbq-alert-title]', exportAs: 'kbqAlertTitle' })
class KbqAlertTitle {}

KbqAlertColors

enumСкопировать ссылку на KbqAlertColors

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'
}

KbqAlertStyles

enumСкопировать ссылку на KbqAlertStyles

Visual style of an alert.

enum KbqAlertStyles {
    Default = 'default',
    Colored = 'colored'
}
DefaultСкопировать ссылку на Default'default'

Neutral background; the status is conveyed by the icon color only.

ColoredСкопировать ссылку на Colored'colored'

Colored background matching the status — use to draw attention when a default alert gets lost on screen.

Предложения по улучшению
Если вы нашли ошибку или хотите доработать статью, создайте запрос на GitHub.