• Stars
    star
    560
  • Rank 79,541 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ” Password strength meter based on zxcvbn in vue.js

๐Ÿ”“ vue-password-strength-meter

Build Status npm version vue2 license

ko-fi

Interactive password strength meter based on zxcvbn for vue.js

๐Ÿ”“

๐Ÿ“บ Demo

Demo here

๐Ÿ”ง Install

yarn add vue-password-strength-meter zxcvbn

๐Ÿ‘ˆ Usage

<template>
  <password v-model="password"/>
</template>

<script>
  import Password from 'vue-password-strength-meter'
  export default {
    components: { Password },
    data: () => ({
      password: null
    })
  }
</script>

๐Ÿ‘ˆ With events

<template>
  <password
    v-model="password"
    :toggle="true"
    @score="showScore"
    @feedback="showFeedback"
  />
</template>

<script>
  import Password from 'vue-password-strength-meter'
  export default {
    components: { Password },
    data: () => ({
      password: null
    }),
    methods: {
      showFeedback ({suggestions, warning}) {
        console.log('๐Ÿ™', suggestions)
        console.log('โš ', warning)
      },
      showScore (score) {
        console.log('๐Ÿ’ฏ', score)
      }
    }
  }
</script>

With custom input

<template>
  <div>
    <input type="password" v-model="password">
    <password v-model="password" :strength-meter-only="true"/>
  </div>
</template>

<script>
  import Password from 'vue-password-strength-meter'
  export default {
    components: { Password },
    data: () => ({
      password: null
    })
  }
</script>

Props

Prop Type Default Value Description
secureLength Number 7 password min length
badge Boolean true display password count badge
toggle Boolean false show button to toggle password visibility
showPassword Boolean false If you are not using the toggle button you can directly show / hide the password with this prop
defaultClass String Password__field input field class
disabledClass String Password__field--disabled disabled input field class
errorClass String Password__badge--error error class for password count badge
successClass String Password__badge--success success class for password count badge
strengthMeterClass String Password__strength-meter strength-meter class
strengthMeterFillClass String Password__strength-meter--fill strength-meter class for individual data fills
showStrengthMeter Boolean true Hide the Strength Meter if you want to implement your own
strengthMeterOnly Boolean false Hides the built-in input if you want to implement your own
labelHide String 'Hide Password' Label for the hide icon
labelShow String 'Show Password' Label for the show icon
userInputs Array empty array Array of strings that zxcvbn will treat as an extra dictionary
referenceValue String 'input' Prop to change the ref of the input. This way you can have the input outside of the component.

Events

Show / Hide Password

  • @show will be emitted if showing the password
  • @hide will be emitted if hiding the password
  • @score will return the zxcvbn score (Integer from 0-4) [โ„น] (https://github.com/dropbox/zxcvbn#usage)
  • @feedback will return an zxcvbn feedback object with suggestion and warning

๐Ÿ’… Customizing

You can customize the styling of the input field, badge and strength-meter by passing your own css classes to defaultClass, strengthMeterClass etc.

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# run unit tests
npm run unit

# run all tests
npm test

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

Support

Buy Me A Coffee

More Repositories

1

vue-chartjs

๐Ÿ“Š Vue.js wrapper for Chart.js
TypeScript
5,542
star
2

vue-parallax

๐ŸŒŒ Vue.js component for parallax image scroll effects
JavaScript
637
star
3

vue-cookie-law

๐Ÿช ๐Ÿ‘ฎ Hackable EU Cookie Law Plugin for Vue.js
JavaScript
376
star
4

vue-breakpoints

๐Ÿฌ ๐Ÿ™ˆ Vue.js utility component to show and hide components based on breakpoints
JavaScript
194
star
5

npm-stats

๐Ÿ“ˆ npm package statistics dashboard build with vue
Vue
113
star
6

shopware-api-client

๐Ÿ› Javascript API Client for Shopware
JavaScript
32
star
7

vue-observable

IntersectionObserver, MutationObserver and PerformanceObserver in Vue.js
JavaScript
24
star
8

wipfred

๐ŸšงManage your wip.chat todos with alfred
JavaScript
21
star
9

sketch-flip-size

๐Ÿ” FlipSize is a small Sketch plugin to flip the size of a shape, layer or artboard
JavaScript
17
star
10

vscode-icon

๐ŸŒ€ Round OSX icon for VSCode ๐Ÿš€
16
star
11

vue-chartjs-demo

๐Ÿ“Š ๐Ÿ“ˆ Github Pages with demo charts for vue-chartjs
JavaScript
16
star
12

alfred-git-snippets

Alfred Powerpack snippets for git commit messages that are awesome
11
star
13

colourhunt

๐ŸŽจCommunity driven colour palettes
Vue
10
star
14

wiviz

Wifi client probe analyzer & visualizer
JavaScript
10
star
15

vue-chartjs-vuex

Sample project for vue-chartjs with vuex
JavaScript
9
star
16

bs3stat

๐Ÿ“Š Small dashboard service for backup ๐Ÿ’พ
Vue
7
star
17

alibaba-discount-alert

๐Ÿšจ Alert service for aliexpress discounts
JavaScript
5
star
18

mina-hipchat

HipChat room notifications for mina deploy
Ruby
3
star
19

presentation-vuex-testing

๐Ÿ’ ๐Ÿ’ฌ Slides of my vuex testing talk
3
star
20

flipper-de

FlipperZero Database for german signals
3
star
21

hacker-zines

Zines, Newsletters and Stuff that may be older than you!
2
star
22

deepbook

A social network prototype build with laravel
PHP
1
star
23

vuex-notes-app

๐Ÿ““ Vue.js note app with vuex for testing purposes
JavaScript
1
star
24

vue-chartjs-quasar

JavaScript
1
star