Form outcome
Confirm that a save finished or explain what prevented submission.
Components / Display
A static notice surface with composable title, description, action, and icon regions.
npx @getweini/cli@latest add alertConfirm that a save finished or explain what prevented submission.
Keep an important policy or deadline visible with a relevant action.
<script setup lang="ts">
import Alert from './components/ui/alert/Alert.vue'
import AlertAction from './components/ui/alert/AlertAction.vue'
import AlertDescription from './components/ui/alert/AlertDescription.vue'
import AlertTitle from './components/ui/alert/AlertTitle.vue'
import Button from './components/ui/button/Button.vue'
</script>
<template>
<Alert variant="warning">
<AlertTitle>Payment method expiring</AlertTitle>
<AlertDescription>Update the card before the next invoice.</AlertDescription>
<AlertAction><Button variant="outline">Update card</Button></AlertAction>
</Alert>
</template>A polite status works for an update inserted after an action.
<script setup lang="ts">
import Alert from './components/ui/alert/Alert.vue'
import AlertDescription from './components/ui/alert/AlertDescription.vue'
import AlertTitle from './components/ui/alert/AlertTitle.vue'
</script>
<template>
<Alert role="status" variant="success">
<AlertTitle>Changes saved</AlertTitle><AlertDescription>Your preferences are ready on every device.</AlertDescription>
</Alert>
</template>A notice already present at page load does not need a live-region role.
<script setup lang="ts">
import Alert from './components/ui/alert/Alert.vue'
import AlertAction from './components/ui/alert/AlertAction.vue'
import AlertDescription from './components/ui/alert/AlertDescription.vue'
import AlertTitle from './components/ui/alert/AlertTitle.vue'
import Link from './components/ui/link/Link.vue'
</script>
<template>
<Alert variant="warning">
<AlertTitle>Review your billing address</AlertTitle>
<AlertDescription>The next invoice is due on 30 September.</AlertDescription>
<AlertAction><Link href="/billing">Open billing</Link></AlertAction>
</Alert>
</template>The most useful props, models, slots, events, and methods for this component.
| Name | Type | Default or requirement |
|---|---|---|
variant | default | info | success | warning | destructive | default |
role | alert | status | none |
icon | decorative slot | empty |
AlertTitle as | h2 | h3 | h4 | h5 | h6 | h3 |
No live-region role is added by default. Use alert only for urgent content inserted dynamically, status for polite updates, and neither for ordinary static page content.