useNotifications API
Notification lifecycle management with severity levels, state mutations, toast queuing, and auto-dismiss.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| useNotifications | Plugins |
| Snackbar | Semantic |
| createRegistry | Registration |
| createQueue | Registration |
| createPlugin | Foundation |
Functions
createNotifications
(_options?: NotificationsOptions & { adapter?: NotificationsAdapter; }) => NotificationsContext<NotificationTicketInput, NotificationTicket<NotificationTicketInput>>createNotificationsContext
<_E>(_options?: NotificationsPluginOptions | undefined) => ContextTrinity<_E>createNotificationsPlugin
(_options?: (NotificationsPluginOptions & Pick<{ namespace?: string; persist?: boolean; devtools?: boolean; }, "devtools">) | undefined) => PluginuseNotifications
<_E>(namespace?: string) => _EOptions
Properties
queue
QueueContext<QueueTicketInput<unknown>, QueueTicket<QueueTicketInput<unknown>>>The toast display queue. Access queue.values(), queue.pause(), queue.resume().
adapter
NotificationsAdapter<NotificationTicketInput, NotificationTicket<NotificationTicketInput>> | undefinedActive notifications adapter, when the plugin was installed with one.
Methods
seek
(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => E | undefinedSeek for a ticket based on direction and optional predicate
on
<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => voidListen for registry events
off
<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => voidStop listening for registry events
emit
<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<E, K>) => voidEmit an event with data
offboard
(ids: ID[]) => Partial<Z>[]Offboard multiple tickets at once, returning the input shapes that were removed.
batch
<R>(fn: () => R) => RExecute operations in a batch, deferring event dispatch and the reactive notification until complete