← All Components
<mth-notification-bell>
Notification bell trigger with unread badge and accessible anchored notification feed popover.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-notification-bell>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/chat/notification-bell"></script>
<mth-notification-bell placement="bottom-end" offset="8"></mth-notification-bell>import '@methane-ui/chat/notification-bell';
import '@methane-ui/react';
export function Example() {
return <mth-notification-bell placement="bottom-end" offset="8"></mth-notification-bell>;
}<script setup lang="ts">
import '@methane-ui/chat/notification-bell';
</script>
<template>
<mth-notification-bell placement="bottom-end" offset="8"></mth-notification-bell>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/chat/notification-bell';
import { MthNotificationBellDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthNotificationBellDirective],
template: `<mth-notification-bell placement="bottom-end" offset="8"></mth-notification-bell>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/chat/notification-bell';
import MthNotificationBell from '@methane-ui/svelte/MthNotificationBell.svelte';
</script>
<MthNotificationBell placement="bottom-end" offset="8"></MthNotificationBell>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Controls open visibility of the notification popover. |
placement | placement | string | "bottom-end" | Preferred popover placement relative to the bell button. |
offset | offset | number | 8 | Pixel offset between bell trigger and notification panel. |
closeOnEscape | close-on-escape | boolean | true | Allows dismissing the panel with the Escape key. |
forceFallback | force-fallback | boolean | false | Forces non-top-layer positioning fallback mode. |
unreadCount | unread-count | number | null | null | Optional explicit unread count overriding computed item count. |
maxCount | max-count | number | 99 | Maximum unread count before appending +. |
useStore | use-store | boolean | true | Subscribes to the shared @methane-ui/core runtime notification store. |
label | label | string | "" | Optional accessible label for the notification bell button. |
items | — | ReadonlyArray<unknown> | — | Structured list of notification items rendered in the panel. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-open | void | Cancelable event emitted before opening the notification panel. |
mth-after-open | void | Emitted after opening completes. |
mth-close | { reason: string } | Cancelable event emitted before closing the notification panel. |
mth-after-close | { reason: string } | Emitted after closing completes. |
mth-item-select | { id: string } | Emitted when the user activates a notification item. |
mth-item-dismiss | { id: string } | Emitted when a notification item is dismissed. |
mth-mark-all-read | void | Emitted when the user activates Mark all read. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Escape | both | notification panel is open and closeOnEscape is true | closes the notification panel and restores focus to the trigger button |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 1 APG keyboard transitions across LTR/RTL. | mth-notification-bell.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open), :state(unread). | Conformance suite |
| i18n | Routes 9 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |