Giter Site home page Giter Site logo

dannyfeliz / vue-notification-bell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrastiak/vue-notification-bell

1.0 3.0 0.0 1.96 MB

Vue.js notification bell component.

Home Page: https://carrene.github.io/vue-notification-bell/

License: MIT License

JavaScript 9.19% HTML 4.10% Vue 86.71%

vue-notification-bell's Introduction

vue-notification-bell

vue-notification-bell

npm version

A Vue UI component for showing notifications. Demo Page

How To Install

npm install vue-notification-bell --save

How to use

Inside your vue files:

<template>
  <div id="your-component">
    <notification-bell /> <!-- Using Component -->
  </div>
</template>
<script>
// Importing Component
import NotificationBell from 'vue-notification-bell'

export default {
  name: 'YourComponentName',
  // ...
  components: {
    NotificationBell  // Registering Component
  }
  // ...
}
</script>

List of component props

⚠️ Warning: You have to v-bind custom icon path with require function:

v-bind:icon="require(@/assets/path/to/icon.svg)" ✔️

:icon="require(@/assets/path/to/icon.svg)" ✔️

icon="@/assets/path/to/icon.svg"

icon="require(@/assets/path/to/icon.svg)"

propName description default value
size size of component in px 30
count number of notifications. (zero or below not shown) 0
upperLimit if count is bigger than this number notification shown as +upperLimit 99
counterLocation position of counter box in component. can be one of: upperRight, lowerRight, upperLeft, lowerLeft, top, left, bottom, right and center. If you set top or left prop, this prop will be disabled upperRight
top If you want to set a custom location for counterBox, you can set top distance by this prop. You have to pass value with dimension (e.g. 10px or 20%). If you set this prop the counterLocation prop will be disabled null (Location is calculated by counterLocation)
left If you want to set a custom location for counterBox, you can set left distance by this prop. You have to pass value with dimension (e.g. 10px or 20%). If you set this prop the counterLocation prop will be disabled null (Location is calculated by counterLocation)
icon custom notification icon. you have to pass your SVG icon location by require function null (showing the default bell icon)
iconColor color of the bell icon. This property only works with default icon. if you are using custom icon, you have to handle color of the icon in your SVG file black
disabledIcon If you want to show a different Icon when you have zero notification. you can use this prop. pass SVG icon location by require function. this prop only works if you are using custom icon too null (showing the default bell icon)
counterStyle shape of counter box. can be one of: roundRectangle, rectangle, round roundRectangle
counterBackgroundColor background color of counter box red
counterTextColor counter text color white
animated if true, counter increase/decrease by animation true

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build-bundle

Lints and fixes files

npm run lint

License

MIT

vue-notification-bell's People

Contributors

maryayi avatar mrastiak avatar dannyfeliz avatar

Stargazers

Karina Rodriguez Herrera avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.