Skip to main content

dyte-notification

A component which shows a notification.

You need to remove the element after you receive the dyteNotificationDismiss event.

<dyte-notification id="dyte-el"></dyte-notification>

<script>
const el = document.getElementById('dyte-el');

el.addEventListener('dyteNotificationDismiss', (e) => {
e.target.remove();
});

el.notification = {
id: 'your-id',
message: 'Vaibhav says hi!',
image: 'https://github.com/vaibhavshn.png',
button: {
text: 'Say Hi back',
variant: 'ghost',
onClick: () => alert('Hey'),
},
};
</script>

Props

notification

required

Message

iconPack

Icon pack

Default
defaultIconPack

size

Size

Type
"lg" | "md" | "sm" | "xl"

t

Language

Default
useLanguage()