Password

Components for handling passwords and other secrets.

Installation

jsrepo add ui/password

Usage

Toggle Visibility

Add a button to toggle the visibility of the password.

Copy

Add a button to copy the secret to the clipboard.

Both

You can also add both a visibility toggle and a copy button and they will play nicely.

Strength

Add a strength meter to the password input using zxcvbn-ts

When a password is too weak (as determined by the minScore prop) the input is marked as invalid and users will be unable to submit the form.

Poor

API Reference

Password.

Root

The root container for the password input suite.

PropTypeDefault
ref? $bindable
HTMLDivElement null
hidden? $bindable
boolean true
minScore?
enum 3
children?
Snippet -
Password.

Input

The password input field.

PropTypeDefault
ref? $bindable
HTMLInputElement null
value? $bindable
string -
children?
Snippet -
Password.

ToggleVisibility

A button to toggle password visibility.

Password.

Copy

A button to copy the password value to the clipboard.

Password.

Strength

A meter that visually indicates password strength.

PropTypeDefault
strength? $bindable
ZxcvbnResult -