Visual primitive
Vue Alert Component
<DomAlert>A persistent inline notice for status messages, policy warnings, empty-flow guidance, and recoverable errors.
Playground
Try every prop live
Alert playground
Use alerts for persistent inline feedback. Tone controls meaning; variant controls visual weight.
Information available
Properties
Control props
Element to render.
Semantic alert tone.
Visual weight.
Fallback title when the title slot is empty.
Fallback body copy when the default slot is empty.
- AddActions add m12 5v14m5 12h14 actions icon plus new create
- RemoveActions remove m5 12h14 actions icon minus delete
- CloseActions close m6 6l12 12m18 6 6 18 actions icon dismiss x
- CheckActions check m20 6 9 17l-5-5 actions icon done success
- EditActions edit m4 20h4l19 9a2.8 2.8 0 0 0-4-4l4 16v4zm11-13 2 2 actions icon pencil compose
- CopyActions copy m8 8h11v11h8v8zm-3 8h4v4h12v1 actions icon duplicate
- ShareActions share m8 12h8m15 7l5 5-5 5m4 5v14 actions icon send
- DownloadActions download m12 4v10m8 10l4 4 4-4m5 19h14 actions icon export
- UploadActions upload m12 16v4m8 8l4-4 4 4m5 20h14 actions icon import
- SearchNavigation search m10.5 18a7.5 7.5 0 1 1 5.3-2.2l21 21 navigation icon find
- FilterNavigation filter m5 6h14m8 12h8m10 18h4 navigation icon funnel
- SettingsNavigation settings m12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm0-5v3m12 18v3m4.2 4.2l2.1 2.1m17.7 17.7l2.1 2.1m3 12h3m18 12h3m4.2 19.8l2.1-2.1m17.7 6.3l2.1-2.1 navigation icon gear
- MenuNavigation menu m6 7h12m6 12h12m6 17h12 navigation icon list
- More horizontalNavigation more horizontal m5 12h.01m12 12h.01m19 12h.01 navigation icon ellipsis
- More verticalNavigation more vertical m12 5h.01m12 12h.01m12 19h.01 navigation icon ellipsis
- Chevron downNavigation chevron down m7 10l5 5 5-5 navigation icon expand
- Chevron upNavigation chevron up m7 14l5-5 5 5 navigation icon collapse
- Chevron leftNavigation chevron left m14 7l-5 5 5 5 navigation icon previous
- Chevron rightNavigation chevron right m10 7l5 5-5 5 navigation icon next
- Arrow leftNavigation arrow left m19 12h5m12 5l-7 7 7 7 navigation icon back
- Arrow rightNavigation arrow right m5 12h14m12 5l7 7-7 7 navigation icon forward
- Arrow upNavigation arrow up m12 19v5m5 12l7-7 7 7 navigation icon top
- Arrow downNavigation arrow down m12 5v14m5 12l7 7 7-7 navigation icon bottom
- HomeNavigation home m4 11 12 4l8 7v9h-5v-6h9v6h4v-9z navigation icon house
- External linkNavigation external link m14 5h5v5m13 11l6-6m19 14v5h5v5h5 navigation icon open
- InfoStatus info m12 17v-5m12 8h.01m21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z status icon notice
- SuccessStatus success m21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0zm8.5 12.5l2.5 2.5 4.5-5 status icon check complete
- WarningStatus warning m12 4l9 16h3l12 4zm12 9v4m12 17h.01 status icon alert risk
- ErrorStatus error m21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0zm15 9l-6 6m9 9l6 6 status icon danger failed
- HelpStatus help m9.5 9a2.5 2.5 0 1 1 4.2 1.8c-.9.7-1.7 1.2-1.7 2.7m12 17h.01m21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z status icon question
- LockSecurity lock m7 11v8a5 5 0 0 1 10 0v3m6 11h12v9h6v-9zm6 3v2 security icon secure
- UnlockSecurity unlock m8 11v8a5 5 0 0 1 9.5-2.2m6 11h12v9h6v-9zm6 3v2 security icon open
- ShieldSecurity shield m12 3 5 6v5c0 4.5 3 8 7 10 4-2 7-5.5 7-10v6l-7-3zm9.5 12l1.75 1.75l15 10 security icon protect
- UserPeople user m12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm5 20a7 7 0 0 1 14 0 people icon profile
- UsersPeople users m9 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm8 1a3 3 0 1 0 0-6m4 20a5 5 0 0 1 10 0m13 20a5 5 0 0 1 7-4.5 people icon team
- MailCommunication mail m4 6h16v12h4v6zm0 0 8 7 8-7 communication icon email
- MessageCommunication message m5 6h14v9h9l-4 4v6z communication icon chat comment
- BellCommunication bell m15 17h9m9-2h6l2-3v9a4 4 0 0 1 8 0v3l2 3zm10 19a2 2 0 0 0 4 0 communication icon notification
- CalendarTime calendar m7 4v3m17 4v3m5 8h14m6 6h12v13h6v6zm3 6h2m13 12h2m9 16h2 time icon date
- ClockTime clock m12 6v6l4 2m12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z time icon time
- FileFiles file m6 4h8l4 4v12h6v4zm8 0v5h5m9 13h6m9 16h4 files icon document
- FolderFiles folder m4 6h6l2 2h8v10h4v6z files icon directory
- ImageFiles image m5 6h14v12h5v6zm3 9 3-3 2 2 2-3 3 4m8 9h.01 files icon media
- CodeFiles code m8 9l-4 3 4 3m16 9l4 3-4 3m14 5l-4 14 files icon developer
- DatabaseData database m5 7c0-2 14-2 14 0v10c0 2-14 2-14 0v7zm0 0c0 2 14 2 14 0m5 12c0 2 14 2 14 0 data icon storage
- TableData table m5 5h14v14h5v5zm0 5h14m5 14h14m10 5v14m15 5v14 data icon grid
- Chart barData chart bar m5 19v9m12 19v5m19 19v-7m4 19h16 data icon analytics
- Chart lineData chart line m4 17l5-5 4 4 7-9m4 20h16 data icon growth
- CardInterface card m5 7h14v10h5v7zm3 3h8m8 14h5 interface icon panel
- DashboardInterface dashboard m4 5h7v7h4v5zm9 0h7v5h-7v5zm4 14h7v5h4v-5zm9-2h7v7h-7v-7z interface icon layout
- MobileInterface mobile m8 3h8a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h8a2 2 0 0 1-2-2v5a2 2 0 0 1 2-2zm3 15h4 interface icon phone
- WindowInterface window m4 5h16v14h4v5zm0 4h16m8 7h.01m11 7h.01 interface icon browser
- GlobePlaces globe m21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0zm3 12h18m12 3c2 2.5 3 5.5 3 9s-1 6.5-3 9m12 3c-2 2.5-3 5.5-3 9s1 6.5 3 9 places icon world web
- Map pinPlaces map pin m12 21s7-5.5 7-11a7 7 0 1 0-14 0c0 5.5 7 11 7 11zm0-8a3 3 0 1 0 0-6 3 3 0 0 0 0 6z places icon location
- StarObjects star m12 3l2.7 5.5 6.1.9-4.4 4.3 1 6-5.4-2.9-5.4 2.9 1-6-4.4-4.3 6.1-.9l12 3z objects icon favorite
- HeartObjects heart m12 20s-8-4.8-8-11a4.5 4.5 0 0 1 8-2.8a4.5 4.5 0 0 1 20 9c0 6.2-8 11-8 11z objects icon love
- SparklesObjects sparkles m12 3l1.8 5.2l19 10l-5.2 1.8l12 17l-1.8-5.2l5 10l5.2-1.8l12 3zm6 9 .9 2.6 2.6.9-2.6.9l18 20l-.9-2.6-2.6-.9 2.6-.9l18 12z objects icon magic ai
- RocketObjects rocket m5 19c1.5-4 4-6.5 8-8l2-6 4 4-6 2c-1.5 4-4 6.5-8 8zm4-4-4 4m14 6l4 4 objects icon launch
- TagCommerce tag m4 12 12 4h7v7l-8 8-7-7zm11-5h.01 commerce icon label
- Credit cardCommerce credit card m4 7h16v10h4v7zm0 3h16m7 14h4 commerce icon payment
- ReceiptCommerce receipt m7 4h10v16l-2-1-2 1-2-1-2 1-2-1-2 1v4zm3 5h4m10 13h4m10 17h2 commerce icon invoice
Show a tone icon, hide it with false, pass SVG path data, or pass an imported Vue icon component.
Accessible label for the optional dismiss button.
ARIA role override. Danger and warning default to alert; other tones default to status.
npm install @getdom/studio<script setup>
import '@getdom/studio/style.css';
import { reactive } from 'vue';
import { DomAlert } from '@getdom/studio';
const data = reactive({
"as": "div",
"tone": "info",
"variant": "soft",
"title": "Information available",
"description": "Review the latest status details before continuing.",
"icon": true,
"dismissible": false,
"dismissLabel": "Dismiss alert",
"role": ""
});
</script>
<template>
<DomAlert
v-bind="data"
/>
</template>Variants
Status tones
Use info, success, warning, danger, and neutral/default tones for persistent notices that match the toast notification vocabulary.
Information available
Changes saved
Review recommended
Action failed
General notice
npm install @getdom/studio<script setup>
import '@getdom/studio/style.css';
import { DomAlert } from '@getdom/studio';
const alerts = [
{
tone: 'info',
title: 'Information available',
description: 'A new policy summary is ready for review before the workflow continues.',
},
{
tone: 'success',
title: 'Changes saved',
description: 'Your configuration is stored and will be used for the next deployment.',
},
{
tone: 'warning',
title: 'Review recommended',
description: 'Two integrations need updated credentials before the sync window starts.',
},
{
tone: 'danger',
title: 'Action failed',
description: 'The publish request could not complete because required fields are missing.',
},
{
tone: 'default',
title: 'General notice',
description: 'This message is informational but not tied to a specific success or failure state.',
},
];
</script>
<template>
<div class="grid gap-3">
<DomAlert
v-for="alert in alerts"
:key="alert.tone"
:tone="alert.tone"
:title="alert.title"
:description="alert.description"
/>
</div>
</template>
Variant
Toast-like alerts
Use the toast variant for inline messages that should feel close to transient notifications, or solid for high-priority notices.
Import complete
Sync paused
Billing hold
npm install @getdom/studio<script setup>
import '@getdom/studio/style.css';
import { DomAlert, DomButton } from '@getdom/studio';
</script>
<template>
<div class="grid gap-4">
<DomAlert
tone="success"
variant="toast"
title="Import complete"
description="1,248 customer records were matched and the review queue has been refreshed."
>
<template #actions>
<DomButton variant="secondary" size="sm">View records</DomButton>
<DomButton variant="ghost" size="sm">Download report</DomButton>
</template>
</DomAlert>
<DomAlert
tone="warning"
variant="toast"
title="Sync paused"
description="Reconnect the analytics account before the nightly enrichment job starts."
/>
<DomAlert
tone="danger"
variant="solid"
title="Billing hold"
description="Exports are paused until a billing owner updates the payment method."
/>
</div>
</template>
Icons
Custom icon sources
Pass SVG path data directly, pass an imported Vue icon component, or set icon to false for text-only alerts.
Protected workflow
Cloud sync queued
Text-only notice
npm install @getdom/studio// CustomIcons.vue
<script setup>
import '@getdom/studio/style.css';
import { DomAlert } from '@getdom/studio';
import CloudSyncIcon from './CloudSyncIcon.vue';
const SHIELD_ICON = 'M12 3 5 6v5c0 4.5 3 8 7 10 4-2 7-5.5 7-10V6l-7-3ZM9.5 12l1.75 1.75L15 10';
</script>
<template>
<div class="grid gap-3">
<DomAlert
tone="primary"
title="Protected workflow"
description="This alert uses SVG path data passed through the icon prop."
:icon="SHIELD_ICON"
/>
<DomAlert
tone="info"
variant="outline"
title="Cloud sync queued"
description="This alert uses an imported Vue icon component, the same pattern as DomIconButton."
:icon="CloudSyncIcon"
/>
<DomAlert
tone="default"
variant="toast"
title="Text-only notice"
description="Set icon to false when the message should rely on text and layout alone."
:icon="false"
/>
</div>
</template>
// CloudSyncIcon.vue
<template>
<svg viewBox="0 0 24 24" fill="none">
<path
d="M17.5 18H8a4 4 0 0 1-.7-7.94A5.5 5.5 0 0 1 18 11.5h.5a3.25 3.25 0 0 1 0 6.5h-1M13 11l3 3-3 3M16 14H9"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</template>
Interaction
Dismissible alerts
Enable dismissible only when a persistent notice is safe to hide. The dismiss event fires after the fade completes.
Workspace update available
npm install @getdom/studio<script setup>
import '@getdom/studio/style.css';
import { ref } from 'vue';
import { DomAlert, DomButton } from '@getdom/studio';
const alertKey = ref(0);
const dismissed = ref(false);
/**
* Records that the alert completed its dismiss transition.
*
* @returns {void}
*/
function handleDismiss() {
dismissed.value = true;
}
/**
* Mounts a fresh alert so the dismiss interaction can be tried again.
*
* @returns {void}
*/
function restoreAlert() {
alertKey.value += 1;
dismissed.value = false;
}
</script>
<template>
<div class="grid gap-3">
<DomAlert
:key="alertKey"
dismissible
tone="info"
title="Workspace update available"
description="Refresh when convenient to use the latest editor improvements."
@dismiss="handleDismiss"
/>
<DomButton v-if="dismissed" class="w-fit" variant="secondary" size="sm" @click="restoreAlert">
Show alert again
</DomButton>
</div>
</template>
Reference
Props
Control props
| Name | Type | TS | Default | Description |
|---|---|---|---|---|
as | string | string | 'div' | Element to render. |
tone | 'default' | 'info' | 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | string | 'info' | Semantic alert tone. |
variant | 'soft' | 'outline' | 'solid' | 'toast' | string | 'soft' | Visual weight. |
title | string | string | 'Notice' | Fallback title when the title slot is empty. |
description | string | string | '' | Fallback body copy when the default slot is empty. |
iconts | boolean | string | object | function | boolean | string | Component | true | Show a tone icon, hide it with false, pass SVG path data, or pass an imported Vue icon component. |
dismissible | boolean | boolean | false | Show a close button that fades the alert away when activated. |
dismissLabel | string | string | 'Dismiss alert' | Accessible label for the optional dismiss button. |
role | string | string | '' | ARIA role override. Danger and warning default to alert; other tones default to status. |
Auto-generated from Alert.props and inline _edit hints.
Events
| Name | Payload | Description |
|---|---|---|
| @dismiss | MouseEvent | Emitted after a dismissible alert has finished fading away. |
Names auto-detected from defineEmits and source emit() calls; payload and description from __doc.events when present.
Slots
| Name | Scope | Description |
|---|---|---|
| #icon | — | Replace the leading status icon. Prefer the icon prop for SVG path data or imported Vue icon components. |
| #title | — | Replace the title content. |
| #(default) | — | Alert body. Falls back to the description prop. |
| #actions | — | Action buttons or links aligned below the message. |