Notification Banner
Notification Banner
<NotificationBanner layout="stacked" type="leading-icon" title="Your session expires in 5 minutes" description="Save your work now to avoid losing any unsaved changes in the admin console."Installation
npx sdaia-ui@latest add notification-banner
Usage
import { NotificationBanner } from "@/components/ui/notification-banner"<NotificationBanner layout="stacked" type="leading-icon" />Examples
Stacked
Notification banner with a stacked vertical layout.
<NotificationBanner layout="stacked" type="leading-icon" title="Notification/Alert message title" description="When a Notification/Alert needs a further detailed explanation, it goes here."With Image
Banner with an image displayed alongside the notification content.
<NotificationBanner layout="inline" type="image" imageSrc="https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?w=400&h=400&fit=crop" imageAlt="Notification preview"With Avatar
Banner with a user avatar for person-specific notifications.
<NotificationBanner layout="inline" type="avatar" avatar={{ initials: 'SA' }} title="Notification/Alert message title"API Reference
NotificationBannerProps
Props for the NotificationBanner component.
Prop | Type | Default | Required |
|---|---|---|---|
layout | 'inline' | 'stacked' | 'inline' | optional |
type | 'leading-icon' | 'avatar' | 'progress' | 'image' | 'leading-icon' | optional |
title | ReactNode | - | required |
description | ReactNode | - | optional |
icon | ReactNode | - | optional |
avatar | NotificationBannerAvatar | - | optional |
imageSrc | string | - | optional |
imageAlt | string | '' | optional |
progress | number | 40 | optional |
actions | ReactNode | - | optional |
onDismiss | () => void | - | optional |
hideCloseButton | boolean | false | optional |
dismissLabel | string | 'Close' | optional |
dir | 'ltr' | 'rtl' | - | optional |
rtl | boolean | false (deprecated) | optional |