Skip to main content

Notification Control Props

The NotificationControl component has a minimal API focused on flexibility and ease of use.

Component Import


Props Interface


Required Props

triggerComponent

Type: React.ComponentType<{ unreadCount: number }> Required: Yes A React component that triggers the dropdown. Receives unreadCount as a prop.
Common patterns:

onNotificationClick

Type: (notification: UnifiedAppNotification) => void Required: Yes Callback fired when a notification is clicked. Notification is automatically marked as read.
Notification object structure:

Optional Props

notificationTemplates

Type: AppNotification.NotificationTemplates Default: All notification types enabled Filter which notification types to display.
Example: Only show comment-related notifications:

onViewAllNotifications

Type: () => void Default: undefined (footer button hidden) Callback for “View all notifications” button in footer. When provided, a footer button appears.
When not provided, the footer button is not rendered.

theme

Type: "auto" | "light" | "dark" Default: "auto" Only for styled (inline styles) variant. Controls the color theme of the dropdown.
Uses prefers-color-scheme media query to detect system theme.
Wire to your app’s theme state:
Tailwind variant ignores this prop. Use Tailwind’s dark mode system instead (add dark class to parent element).

Complete Examples

Minimal Usage


With All Features


Utility Functions

The component includes utility functions you can use:

TypeScript Support

Full TypeScript support with exported types:

Next Steps

Customization

Customize colors, layout, and behavior

Integration Examples

See real-world examples

Installation

Installation guide

Overview

Back to overview