Show notifications.
https://luna.liriliri.io/?path=/story/notification
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-notification/luna-notification.css" />
<script src="//cdn.jsdelivr.net/npm/luna-notification/luna-notification.js"></script>
You can also get it on npm.
npm install luna-notification --save
import 'luna-notification/luna-notification.css'
import LunaNotification from 'luna-notification'
const container = document.getElementById('container')
const notification = new LunaNotification(container, {
position: {
x: 'left',
y: 'top',
},
})
notification.notify('luna', {
duration: 2000,
})
notification.dismissAll()
- duration(number): Default duration, 0 means infinite.
- inline(boolean): Enable inline mode.
- position(IPosition): Notification position.
Dismiss all notifications.
Show notification.
- duration(number): Notification duration.
- icon(string): Notification icon.
- x('left' | 'center' | 'right'): X position.
- y('top' | 'bottom'): Y position.