Skip to content

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.
Neutral inline feedback.Helpful context for the user.The operation completed.Something needs attention.Something went wrong.

Bordered

Set bordered for a border around the soft fill (default is fill only).
Soft fill plus a border around the alert.

Closable

closable shows a close control that dispatches bubbling gk-close. The alert does not hide itself — handle the event in the host.
Close emits gk-close; hide or remove the alert in the host.

Icon

Put content in the icon slot to override the built-in type icon.
The icon slot overrides the built-in type icon.

No icon

Bind :show-icon="false" to hide the icon column.
Icon column hidden when show-icon is false.

API ​

Alert Props ​

PropTypeDefault
type'default' | 'info' | 'success' | 'warning' | 'error''default'
titlestring—
borderedbooleanfalse
closablebooleanfalse
show-iconbooleantrue

Alert Slots ​

NameDescription
defaultBody content
iconOverrides the built-in type icon when present

Alert Events ​

NameDescription
gk-closeClose button activated; bubbles; composed: true

CSS Parts ​

PartDescription
baseOuter surface
iconIcon column
bodyTitle + content wrapper
titleTitle line
contentDefault slot wrapper
closeClose button