Notification
A dismissible role="alert" banner island. The close button calls a signal to hide the component. Use autoClose with a millisecond delay to auto-dismiss.
Default
Update available
import { Notification } from '@davaux/ui'
<Notification title="Update available" message="A new version is ready to install." />Colors
Info
Success
Warning
Error
<Notification color="blue" title="Info" message="Request processing." icon={infoIconHtml} />
<Notification color="green" title="Success" message="Changes saved." icon={checkIconHtml} />
<Notification color="yellow" title="Warning" message="Session expiring soon." />
<Notification color="red" title="Error" message="Something went wrong." />Without close button
Persistent notification
<Notification
color="violet"
title="Persistent"
message="Cannot be dismissed."
withCloseButton={false}
/>Motion
Notifications enter with the dv-slide-up-in keyframe — fading in while translating up 8px — at --dv-motion-duration-normal (200ms) with --dv-motion-ease-enter easing. This matches the Modal enter so stacked UI events feel consistent.
Override the animation on .dv-notification to match a custom motion system or to slot into a toast queue with a different feel:
/* Faster, snappier notification */
.dv-notification {
animation-duration: var(--dv-motion-duration-fast);
}
/* Slide in from the right instead */
.dv-notification {
animation-name: dv-slide-left-in;
}See the Motion page for all available keyframes and tokens.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | Heading text above the message |
message | string | '' | Main body text |
color | string | 'blue' | Theme color applied to the icon and accent |
icon | string | — | Raw SVG HTML string for the notification icon |
visible | boolean | true | Initial visibility state |
withCloseButton | boolean | true | Shows the dismiss button |
autoClose | number | 0 | Auto-dismiss after this many milliseconds (0 = disabled) |