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 Examples ​

Variants

Neutral through danger; use role alert only when the message is urgent.

Neutral message.
Info message.
Success message.
Warning message.

Title, text, and border accent

Props for heading and body plus a start-edge accent bar.

With title
Supporting line from the text prop.

Closable

v-model controls visibility after dismiss.

Closable
Dismiss sets v-model to false and removes the alert.

Prominent

Larger padding and top border for high-visibility callouts.

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
titlestring—Heading line (overridden by title slot)
textstring—Body 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 ​

Each scenario under Live Examples includes a copyable Vue snippet (source is imported from the same SFC as the preview).

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.