A toggle switch to show the text of a password field. You can view a demo here: https://crypticsoft.github.io/password-toggle/
-
Download and install from
bower
(use --save or --save-dev).`bower install crypticsoft/password-toggle`
-
Include the component and specify a password selector, this example uses a data attribute:
<password-toggle data-password-selector="input[data-is-password='true']"></password-toggle> <input type="password" name="password" data-is-password="true" value="123456">
-
To preview the element, you can clone the repo (https://github.com/crypticsoft/password-toggle.git) and run:
polymer serve
Open
localhost:8080/components/password-toggle/demo/
in your browser. (Note that the path usespassword-toggle
—the component name listed in this element'sbower.json
file—rather than the actual directory name.)
If you're wondering what polymer serve
does, see Testing elements with local bower dependencies
in the Polymer docs.