aak-nuxt3-notifications
Adds a notification feature to the Nuxt3 app
639
1
| Install | |
|---|---|
npm install aak-nuxt3-notifications |
|
| Latest Version: | 1.0.11 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Apr 22, 2024 |
| Links: | GitHub · npm |
Maintainer: amir.almukhametov
Nuxt3 Notifications Module
This is module aak-nuxt3-notifications for Nuxt3
📦 Get Started
- Install
aak-nuxt3-notificationsas project dependency:
npm i aak-nuxt3-notifications # npm
yarn add aak-nuxt3-notifications # yarn
- Add it to the
modulessection of yournuxt.config:
export default defineNuxtConfig({
modules: [
'aak-nuxt3-notifications',
],
})
🚀 Example

<!-- component.vue -->
<script setup>
const { $notify } = useNuxtApp()
const acceptsAnObject = () => $notify.info({
title: 'Title message',
message: 'Text message',
position: 'bottom-right',
duration: 8000
})
// ‧₊˚✧[Only text]✧˚₊‧
const onlyText = () => $notify.info('You can only specify the text')
const info = () => $notify.info('An info-style message') // 💬
const success = () => $notify.success('An success-style message') // ✅
const warning = () => $notify.warning('An warning-style message') // ⚠️
const error = () => $notify.error('An error-style message') // ❗
</script>
<template>
<button @click="acceptsAnObject">Show notify acceptsAnObject</button>
<button @click="onlyText">Show notify onlyText</button>
<button @click="info">Show notify info</button>
<button @click="success">Show notify success</button>
<button @click="warning">Show notify warning</button>
<button @click="error">Show notify error</button>
</template>

🔨 API
Options
| Name | Description | Type | Default |
|---|---|---|---|
| title | title | string | '' |
| message | description text | string | '' |
| offset | offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset |
number | 0 |
| position | custom position | 'top-right' 'top-left' 'bottom-right' 'bottom-left'" |
top-right |
| duration | duration before close. It will not automatically close if set 0 |
number undefined |
duration is calculated based on the number of characters in a string, but not less than 4000, and if duration === undefined, then duration 4000 |
| type | notification type | 'success' 'warning' 'info' 'error' '' |
'' |
💻 Development
- Fork and clone Azirafel17/nuxt3-notification-module
- Install dependencies using
npm install - Run
npm dev:prepareto generate type stubs. - Use
npm devto start playground in development mode.
Related Packages
nuxt-facebook-chat
Effortless integration of Facebook's Customer Chat SDK into Nuxt 3. Enhance user...
1,874
7
nuxt-define
One utility function for module authors to define compiler constants for all bui...
13,412,511
@zadigetvoltaire/nuxt-well-known
Nuxt module to add well-known files and rules with middlewares
37,344
22
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.11 | ^3.0 | MIT | |
| 1.0.10 | ^3.0 | MIT | |
| 1.0.9 | ^3.0 | MIT | |
| 1.0.8 | ^3.0 | MIT | |
| 1.0.7 | ^3.0 | MIT | |
| 1.0.6 | ^3.0 | MIT | |
| 1.0.5 | ^3.0 | MIT | |
| 1.0.4 | ^3.0 | MIT | |
| 1.0.3 | ^3.0 | MIT | |
| 0.0.2 | ^3.0 | MIT |