Skip to main content

rtk-notification

A component which shows a notification.

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

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

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

el.addEventListener('rtkNotificationDismiss', (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

paused

Stops timeout when true

Type
boolean

size

Size

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

t

Language

Default
useLanguage()