Skip to main content

LgNotificationCounter

LgNotificationCounter displays a numerical value in a notification badge. It is a very low-level component: it loads no notifications and does not connect to the client service.

<LgNotificationCounter Counter="3" />
  • Namespace: Lagoon.UI.Components.Internal
  • Inherits from: ComponentBase
  • NuGet package: Lagoon.UI.Notifications

Usage​

Counter managed by a page​

Use this component only if you already manage the calculation of the number to display. For full menu integration, prefer LgNotificationMenuItem.

NotificationBadge.razor
<LgNotificationCounter Counter="UnreadCount" />
NotificationBadge.razor.cs
public partial class NotificationBadge : LgComponentBase
{
// Number calculated by the parent component or by an application service.
private int UnreadCount { get; set; } = 3;
}

Properties​

NameTypeDefaultDeclared inDescription
Counterint0LgNotificationCounterNumber displayed in the badge.

Accessibility​

The component renders only a numerical value in a visual container. Associate it with a label or explicit menu item when the counter must be understood by screen readers.