Feedback
Layout
Message
An inline banner for status text: info, success, warning or error. Use it for a notice that stays in the page.
Install
import { Message } from 'vael-ui'Playground
info
default
undefined
Placement, behaviour and animation
Usage
<script setup lang="ts">
import { Message } from 'vael-ui'
</script>
<template>
<Message variant="info" />
</template>Motion New
Message coming and going: values or hooks for root.
<Message
:motion="{ initial: { root: { opacity: 0, y: 4 } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | root | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
| Key | Action |
|---|---|
| EnterSpace | Closes the message from the focused dismiss button. |
- Renders
role="alert"forerrorandwarningandrole="status"otherwise; theroleprop overrides it. - The
closablebutton is named “Dismiss”. The status icon isaria-hidden. - Closing it from the keyboard moves focus to the next focusable element, so focus doesn’t drop to the page.