2.4.4 • Published 24 days ago

notivue v2.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
24 days ago

Notivue

Powerful toast notification system for Vue and Nuxt

Live Demo - Documentation


Examples: Custom Components - Nuxt - Astro

Features

🧬 Fully modular with zero dependencies
Granularly include only the features you need

✅ Beautiful, ready-made notifications included
Themes, icons, progress bar, and native RTL support

🧩 Headless API
Use your own components while Notivue handles the rest

💊 Drop-in components to enhance notifications
NotivueSwipe, NotivueKeyboard, all optional and customizable

🌀 Dynamic Notifications
Update pending notifications with a breeze

🎢 Slick transitions and animations
Customize animations with CSS classes

♿️ Fully accessible
Built-in announcements, reduced-motion and keyboard support

💫 Nuxt and Astro modules
Built-in Nuxt and Astro ad-hoc modules

Installation

pnpm add notivue

# npm i notivue
# yarn add notivue
# bun i notivue

Vite

:bulb: See ↓ below for Nuxt

main.js/ts

import { createApp } from 'vue'
import { createNotivue } from 'notivue'

import App from './App.vue'

import 'notivue/notification.css' // Only needed if using built-in <Notification />
import 'notivue/animations.css' // Only needed if using default animations

const notivue = createNotivue(/* Options */)
const app = createApp(App)

app.use(notivue)
app.mount('#app')

App.vue

<script setup>
import { Notivue, Notification, push } from 'notivue'
</script>

<template>
  <button @click="push.success('Hi! I am your first notification!')">Push</button>

  <Notivue v-slot="item">
    <Notification :item="item" />
  </Notivue>

  <!-- RouterView, etc. -->
</template>
<script setup>
import { Notivue, push } from 'notivue'
</script>

<template>
  <button @click="push.success('Hi! I am your first notification!')">Push</button>

  <Notivue v-slot="item">
    <!-- Your notification 👇 -->
    <div class="rounded-full flex py-2 pl-3 bg-slate-700 text-slate-50 text-sm">
      <p :role="item.ariaRole" :aria-live="item.ariaLive" aria-atomic="true">
        {{ item.message }}
      </p>

      <button
        @click="item.clear"
        aria-label="Dismiss"
        class="pl-3 pr-2 hover:text-red-300 transition-colors"
        tabindex="-1"
      >
        <svg
          xmlns="http://www.w3.org/2000/svg"
          viewBox="0 0 20 20"
          fill="currentColor"
          class="w-5 h-5"
          aria-hidden="true"
        >
          <path
            d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z"
          />
        </svg>
      </button>
    </div>
  </Notivue>

  <!-- RouterView, etc. -->
</template>

Nuxt

nuxt.config.ts

export default defineNuxtConfig({
  modules: ['notivue/nuxt'],
  css: [
    'notivue/notification.css', // Only needed if using built-in <Notification />
    'notivue/animations.css' // Only needed if using default animations
  ],
  notivue: {
    // Options
  }
})

app.vue

<template>
  <button @click="push.success('Hi! I am your first notification!')">Push</button>

  <Notivue v-slot="item">
    <Notification :item="item" />
  </Notivue>

  <!-- NuxtLayout, NuxtPage, etc. -->
</template>

Thanks

License

MIT

2.4.4

24 days ago

2.4.1

27 days ago

2.4.0

27 days ago

2.4.3

26 days ago

2.4.2

27 days ago

2.3.0

1 month ago

2.3.2

1 month ago

2.3.1

1 month ago

2.2.1

3 months ago

2.2.0

4 months ago

2.1.1

4 months ago

2.1.0

4 months ago

2.0.1

5 months ago

2.0.0

5 months ago

1.4.5

5 months ago

1.4.4

6 months ago

1.4.3

6 months ago

1.4.2

7 months ago

1.4.1

7 months ago

1.4.0

8 months ago

1.3.3

8 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.3.0

8 months ago

1.2.0

9 months ago

1.1.1

10 months ago

1.0.2

10 months ago

1.1.0

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.9.4

12 months ago

0.9.3

12 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.1.4

9 months ago

1.0.5

10 months ago

1.2.2

9 months ago

1.1.3

10 months ago

1.0.4

10 months ago

1.2.1

9 months ago

1.1.2

10 months ago

1.0.3

10 months ago

0.9.2

1 year ago

0.9.0

1 year ago