Svelte Notification List - Bitblue

Dropdown-style notification inbox with async load, clear, and item click handlers

NotificationList renders a bell-style inbox. Pass static data and/or a read() loader that runs when the menu opens.

Setup

<script lang="ts">
	import { NotificationList } from '.';
</script>

With static data

<script lang="ts">
	import { NotificationList, Button } from '.';
	let open = $state(false);
	const data = [
		{
			id: 1,
			sender: 'Alex',
			content: 'Approved your request',
			time: '2m ago',
			isRead: false,
			icon: 'mdi:bell'
		},
		{
			id: 2,
			sender: 'Sam',
			content: 'Commented on a ticket',
			time: '1h ago',
			isRead: true
		}
	];
</script>

<Button onclick={() => (open = !open)}>Notifications</Button>
<NotificationList bind:open {data} onclick={(item) => console.log(item)} />

Async read

<script lang="ts">
	import { NotificationList } from '.';
	async function read() {
		const res = await fetch('/api/notifications');
		return res.json();
	}
</script>

<NotificationList {read} onClearNotifications={() => {}} />

Notification item shape

FieldTypeDescription
idstring | numberStable id
senderstringTitle / sender
contentstringBody text
timestringRelative time label
isReadbooleanRead state styling
iconstringOptional iconify id

Props

PropTypeDefaultDescription
openbooleanfalseBindable open state
dataNotificationItem[][]Initial / static items
read() => Promise<T[]> \| T[]—Loader when opened
busybooleanfalseLoading indicator
onclick(item: T) => void—Item click
onClearNotifications() => void—Clear action
headersnippet—Custom header
footersnippet—Custom footer

© 2026 Bitblue is a registered trademark. All Rights Reserved.