Components
BasePasswordField
A password field with a show/hide button, a strength meter, live requirements and a Caps Lock warning.
components/ui/inputs/BasePasswordField.vue
View in the demo
Show and strength
Password strength:
Requirements and Caps Lock
Type to see each requirement turn green. Turn Caps Lock on while the field has focus to see the warning.
API
It also accepts every prop, slot and event of v-text-field, which it passes through.
Props
Name | Type | Default | Description |
|---|---|---|---|
autocomplete | "current-password" | "new-password" | "current-password" | current-password for sign-in, new-password for registration and password changes. |
show-strength | boolean | false | Shows a strength meter (weak, fair, good, strong) under the field. |
show-requirements | boolean | false | Lists the rules (8 characters, a letter, a number) and checks them as the user types. |
caps-lock-warning | boolean | false | Warns while Caps Lock is on. |
v-model | string | null | "" | The password. |
Events
Name | Payload | Description |
|---|---|---|
@update:modelValue | [value: string | null] | — |
Every BaseTextField prop and slot works too, including label, rules and #label-append.
Accessibility
The show/hide button has an aria-label and aria-pressed. The strength and the requirements are announced politely as they change.