Skip to content
Back to Components

NotificationCard

@hua-labs/ui/advanced/dashboard
v1.0.0

bash
npm install @hua-labs/hua
tsx
import { NotificationCard } from "@hua-labs/ui/advanced/dashboard";

3

Info

Success

Warning

Error

4

Props

items*NotificationItem[]-Array of notification items to display
titlestring"Notifications"Card header title
emptyMessagestring"No notifications"Message shown when there are no items
maxItemsnumber-Maximum number of items to display
onViewAll() => void-Handler for 'View All' button
viewAllLabelstring"View All"Label for the view all button
showHeaderbooleantrueWhether to show the header section
showCountbooleantrueWhether to show notification count
emptyStateReact.ReactNode-Custom empty state component

NotificationItem

id*string-Unique identifier
title*string-Notification title
message*string-Notification message
timestamp*Date | string-When the notification was created
type"info" | "warning" | "error" | "success"-Notification type (affects styling)
iconIconName | React.ReactNode-Custom icon
onClick() => void-Click handler for the item
hrefstring-Link URL for the item

BasicNotificationCard.tsxtsx
import { NotificationCard } from "@hua-labs/ui/advanced/dashboard";

export function BasicNotificationCard() {
  const notifications = [
    {
      id: "1",
      title: "New Order",
      message: "Order #1234 has been created",
      timestamp: new Date(),
      type: "success" as const
    },
    {
      id: "2",
      title: "System Alert",
      message: "Server maintenance is scheduled",
      timestamp: new Date(Date.now() - 3600000),
      type: "warning" as const
    }
  ];

  return (
    <NotificationCard
      title="Notifications"
      items={notifications}
    />
  );
}