Alert
Alert shows inline feedback with semantic types, optional border, built-in icons, and closable behavior that matches Card (gk-close only).
Demos
Basic
Types:
default, info, success, warning, and error. Each type sets color and the built-in icon. Bordered
Set
bordered for a border around the soft fill (default is fill only). Closable
closable shows a close control that dispatches bubbling gk-close. The alert does not hide itself — handle the event in the host. gk-close; hide or remove the alert in the host. Icon
Put content in the
icon slot to override the built-in type icon. icon slot overrides the built-in type icon. No icon
Bind
:show-icon="false" to hide the icon column. show-icon is false. API
Alert Props
| Prop | Type | Default |
|---|---|---|
type | 'default' | 'info' | 'success' | 'warning' | 'error' | 'default' |
title | string | — |
bordered | boolean | false |
closable | boolean | false |
show-icon | boolean | true |
Alert Slots
| Name | Description |
|---|---|
| default | Body content |
icon | Overrides the built-in type icon when present |
Alert Events
| Name | Description |
|---|---|
gk-close | Close button activated; bubbles; composed: true |
CSS Parts
| Part | Description |
|---|---|
base | Outer surface |
icon | Icon column |
body | Title + content wrapper |
title | Title line |
content | Default slot wrapper |
close | Close button |