Password Visibility Toggler In Vanilla JavaScript

Category: Form , Javascript | May 11, 2020
Views Total:222 views
Official Page:Go to website
Last Update:May 11, 2020


Password Visibility Toggler In Vanilla JavaScript


A Custom Element to create an SVG password visibility toggler that enables the users to reveal passwords behind asterisks on click.

How to use it:

1. Import the custom-element-password-toggle

# Yarn
$ yarn add custom-element-password-toggle
$ npm install custom-element-password-toggle --save

2. Import the component.

<script type="module" defer>
  import 'custom-element-password-toggle'
// or from a CDN
<script type="module" defer src=""></script>

3. Add the is=”password-toggle” to the password field and done.

<input type="password" is="password-toggle" />

You Might Be Interested In:

Leave a Reply