Getting Started with the Kendo UI for Vue Native Notification

This guide provides essential information about using the Kendo UI for Vue Native Notification package component—you will learn how to install the Notification package, add a Notification component to your project, style the component, and activate your license.

ninja-iconThe Notification is part of Kendo UI for Vue, a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.Start Free Trial

After completing this guide, you will be able to reproduce the following example.

Change Theme
Theme
Loading ...

Setting Up Your Vue Project

Before you install the Kendo UI for Vue Native Notification, make sure that you have a running Vue project. The easiest way to set up a Vue project is to use the approach described in the Set up the Vue project section of the First Steps with JavaScript article.

Installing the Notification Package

All Kendo UI for Vue Native packages are distributed through npm and offer a similar installation experience. To use the Notification component, start with the installation of the Notification npm package and its dependencies. Use Node.js v5.0.0 or later.

sh
npm install --save @progress/kendo-vue-notification @progress/kendo-licensing @progress/kendo-svg-icons

Importing the Component

After installing the package, import the Notification and NotificationGroup components in the Vue App.

In the src/App.vue file of your Vue project, import the Notification and NotificationGroup components from the Notification package.

jsx
// ES2015 module syntax
import { Notification, NotificationGroup } from '@progress/kendo-vue-notification';
jsx
// CommonJS format
const { Notification, NotificationGroup } = require('@progress/kendo-vue-notification');

Using the Component

  1. Define a variable that will determine if the Notification will be visible.

    jsx
        data() {
            return {
                success: false,
            };
        },
  2. Define method that will control the visibility of the Notification on a button click.

    jsx
        methods: {
            onToggle(flag) {
                this[flag] = !this[flag];
            },
        },
  3. Add animation to the component by importing the Fade animation.

    jsx
        import { Fade } from '@progress/kendo-vue-animation';
  4. Add the component's markup to the template section of the src/App.vue file in your project. You will render the Notification component based on the success value. Wrap the entire Notification component inside the Fade component to animate it.

    jsx
        <div>
            <button
                class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
                @click="onToggle('success')"
            >
                Toggle Notification
            </button>
            <NotificationGroup
            :style="{
                right: 0,
                bottom: 0,
                alignItems: 'flex-start',
                flexWrap: 'wrap-reverse'
            }"
            >
            <Fade :appear="success">
                <Notification
                v-if="success"
                :type="{ style: 'success', icon: true }"
                :closable="true"
                @close="onToggle('success')"
                >
                <span>Your data has been saved.</span>
                </Notification>
            </Fade>
            </NotificationGroup>
        </div>
  5. To style the Notification, install and import the Default theme, which is one of the four beautiful themes for Kendo UI for Vue.

    1. Install the Default theme package.

      sh
      npm install --save @progress/kendo-theme-default
    2. Import the Theme package in src/App.vue.

      jsx
      import '@progress/kendo-theme-default';
  6. Build, run and test the application by typing the following command in the root folder of your project:

    sh
    npm run dev

Activating Your License Key

Using any of the UI components in the Kendo UI for Vue Native library requires either a commercial license key or an active trial license key.

Follow the instructions on the My License page to activate your trial or commercial license. You can skip this step if your application already contains a Kendo UI for Vue Native license file.

Dependencies

The Notification package requires you to install the following peer dependencies in your application:

Package NameDescription
vue 2.6.14 or 3.0.0+Contains the functionality necessary to define Vue components.
@progress/kendo-licensingContains the internal infrastructure related to licensing.
@progress/kendo-svg-iconsContains the SVG icons for the components

Vue 2 is currently in its end-of-support phase till Nov 2024. After our last major release for 2024, Vue 2 will no longer be supported in the new versions of the Kendo UI for Vue components. Please check our Vue 2 End of Support article for more details.

Learning Resources