Form
InputPassword
A password box with a reveal button and a strength meter.
WAI-ARIA tested
Import
main.ts
import { InputPassword } from '@vitral/vue';Strength meter
Reveal and clear
Sizes and states
API
Read from packages/vue/src/components/InputPassword/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| feedback | boolean | Show a strength meter while the box has focus. Defaults to true. |
| toggleMask | boolean | Add a button that shows the password as plain text, and back. |
| clearable | boolean | Shows a clear button while there is text. |
| promptLabel | string | Shown in the meter before anything is typed. |
| weakLabel | string | — |
| mediumLabel | string | — |
| strongLabel | string | — |
| mediumRegex | string | RegExp | Met by a medium password, as a regular expression or its source. |
| strongRegex | string | RegExp | Met by a strong password, as a regular expression or its source. |
| size | Size | — |
| variant | InputVariant | Defaults to the plugin's `inputVariant`. |
| invalid | boolean | — |
| disabled | boolean | — |
| readonly | boolean | — |
| fluid | boolean | — |
| placement | OverlayPlacement | — |
| appendTo | string | `'body'` (the default), `'self'` to render in place, or a selector. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| focus | event: FocusEvent | — |
| blur | event: FocusEvent | — |
| clear | — | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| header | — | Above the meter. |
| footer | — | Below the meter: the rules a password has to follow. |
| content | (props: { strength: 'weak' | 'medium' | 'strong' | null; label: string }) | Replaces the meter bar; the announced grade stays below it. |
| maskicon | — | — |
| unmaskicon | — | — |