Kobana UI
GitHub

HeaderNotifications

Dropdown de notificações com badge, lista e time-ago.

Instalação

npx @kobana/ui add header-notifications

Importação

import { HeaderNotifications } from "@/components/kobana/header-notifications"

Props

PropTipoDefaultDescrição
notificationsNotificationItem[]Lista de notificações
unreadCountnumberAuto-computadoTotal não lidas
isLoadingbooleanEstado de loading
onNotificationClick(notification) => voidClick na notificação
viewAllHrefstringURL do "Ver todas"
onViewAll() => voidCallback "Ver todas"
renderLink(props) => ReactNodeRender function para links
labels{ title?, empty?, loading?, viewAll?, srLabel? }Labels customizáveis
classNamestringClasses adicionais

NotificationItem

interface NotificationItem {
  id: string
  title: string
  description?: string
  severity?: "info" | "warning" | "error" | "critical"
  timestamp: string  // ISO format
  read?: boolean
  href?: string
}

Uso

<HeaderNotifications
  notifications={notifications}
  onNotificationClick={(n) => router.push(n.href!)}
  viewAllHref="/notifications"
/>

On this page