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

Version License Nuxt Downloads

This is module aak-nuxt3-notifications for Nuxt3

📦 Get Started

  1. Install aak-nuxt3-notifications as project dependency:
npm i aak-nuxt3-notifications # npm

yarn add aak-nuxt3-notifications # yarn
  1. Add it to the modules section of your nuxt.config:
export default defineNuxtConfig({
  modules: [
    'aak-nuxt3-notifications',
  ],
})

🚀 Example

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>

Example

🔨 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

Related Packages

nuxt-plotly

nuxt-plotly module is thin Nuxt3 wrapper for plotly.js

35,721 32
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
@lg2/nuxt3-module-create-dato-map

nuxt3-module-create-dato-map

2,869 0

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