Skip to content

GkAlert

Non-modal status region. Default role="status"; use role="alert" for urgent, interruptive messages.

When to use

Use for inline status feedback that should remain visible in page flow, such as validation summaries or save results.

Live demo

Neutral message.
Info message.
Success message.
Warning message.
With title
Supporting line from the text prop.
Closable
Dismiss sets v-model to false and removes the alert.
Prominent
Extra padding for emphasis.

API

Props

PropTypeDefaultDescription
modelValuebooleantrueVisibility; when false, the component renders nothing
variant'neutral' | 'info' | 'success' | 'warning' | 'danger''neutral'Tone (primary API)
type'success' | 'info' | 'warning' | 'error'Optional alias when variant is default neutral; error maps to danger
role'status' | 'alert''status'ARIA role
titlestringHeading line (overridden by title slot)
textstringBody line after the title (overridden by text slot)
closablebooleanfalseShow a dismiss control (GkButton ghost, small)
closeLabelstring'Dismiss'aria-label for the close control
borderboolean | 'top' | 'end' | 'bottom' | 'start'Accent bar along an edge; true uses logical start
prominentbooleanfalseLarger padding / min-height

Slots

SlotDescription
prependOptional start-aligned content (e.g. icon)
appendOptional end-aligned content before the close control
titleTitle row (wins over title prop)
textText row after title (wins over text prop)
defaultAdditional body after title and text

Order: optional title (prop or slot), then text (prop or slot), then default slot.

Events

EventPayloadDescription
update:modelValuebooleanEmitted when dismissed; false when closing
closeMouseEventClose control activated
click:closeMouseEventSame as close (mirrors common naming)

Examples

Basic

vue
<script setup lang="ts">
import { GkAlert } from 'god-kit/vue'
</script>

<template>
  <GkAlert variant="success">Saved.</GkAlert>

  <GkAlert
    v-model="open"
    variant="info"
    title="Heads up"
    text="Details here."
    closable
    border="start"
  />
</template>

Advanced

vue
<GkAlert
  v-model="open"
  variant="warning"
  title="Quota warning"
  text="Storage usage is near the limit."
  closable
  border="start"
/>

Edge case

vue
<GkAlert role="alert" variant="danger">
  Critical payment sync failed.
</GkAlert>

Accessibility notes

  • Use role=\"alert\" only for urgent interruptions; keep non-urgent updates as status.
  • Provide clear, actionable message text and avoid icon-only communication.

Released under the MIT License.