Skip to content

Installation

TIP

View it with a PC, the effect is even better

Requirements

vue version >=3.2.0

Installation

bash
npm install --save vue3-toastify
npm install --save vue3-toastify
bash
yarn add vue3-toastify
yarn add vue3-toastify

Global config

see: demo --> main.js

demo

WARNING

Don't forget to import styles

For Jsx
jsx
import { toast } from 'vue3-toastify';
import { defineComponent } from 'vue';
import 'vue3-toastify/dist/index.css';

const JsxDemo = defineComponent({
  setup() {
    const notify = () => {
      toast('Wow so easy !');
    };

    return () => (
      <div>
        <button onClick={notify}>Notify !</button>
      </div>
    );
  },
});

export default JsxDemo;
import { toast } from 'vue3-toastify';
import { defineComponent } from 'vue';
import 'vue3-toastify/dist/index.css';

const JsxDemo = defineComponent({
  setup() {
    const notify = () => {
      toast('Wow so easy !');
    };

    return () => (
      <div>
        <button onClick={notify}>Notify !</button>
      </div>
    );
  },
});

export default JsxDemo;
import App from './App.vue';
import { createApp } from 'vue';
import Vue3Toasity, { type ToastContainerOptions } from 'vue3-toastify';
import 'vue3-toastify/dist/index.css';

createApp(App).use(
Vue3Toasity,
{
autoClose: 3000,
// ...
} as ToastContainerOptions,
).mount('#app');

Released under the MIT License.