Password
vig-password
import { Password } from '@vigdx/ui/password';Basic
[(value)] to a string signal. The eye button reveals the text and hides it again. Set autocomplete ( current-password or new-password ) so password managers fill the right field.
0 characters typed.
Strength meter
feedback shows a three-step meter under the field. By default a password is medium with two character classes and 6 characters, and strong with lower case, upper case and a digit and 8 characters. Pass a strength function, (value) => 'weak' | 'medium' | 'strong' , to use your own rules (the regex inputs mediumRegex / strongRegex are deprecated).
Enter a password
At least 8 characters with upper case, lower case and a digit.
Enter a password
Medium from 12 characters, strong from 20.
Label on top, hint and error
labelPosition="top" puts the label above the field. hint adds help text; errors show once the field is touched and invalid , and errorMessages replaces the built-in text for each error kind.
Case-sensitive.
Toggle, disabled, read-only and sizes
[toggleMask]="false" removes the eye button. disabled also disables the button; readonly keeps the field focusable. size is sm , md (default) or lg .
Translated labels
promptLabel , weakLabel , mediumLabel and strongLabel for the meter, showPasswordAriaLabel for the button (its state is aria-pressed , so hidePasswordAriaLabel is deprecated). Without them the texts follow the locale set with provideVigdxUi .
Orta
Reactive Forms
VigValueAccessor next to the component to use formControlName , [formControl] or ngModel . Built-in validators such as Validators.minLength show the kit's messages; submit the empty form to see them.
Signal Forms
vig-password implements FormValueControl<string> , so [formField] binds value, validation and minLength / maxLength . A validate() rule compares the confirmation with the new password.
Enter a password
Valid: no
Styling hooks
Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="password"][data-part="field"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.
Scope: [data-scope="password"]
| Part | Element | data-state |
|---|---|---|
field | — | |
label | — | |
input | <input> . | — |
hint | vig-hint (a display: contents host; style its text part). | — |
disabled-reason | vig-hint with the disabled reason ( display: contents ). | — |
error | vig-field-error (a display: contents host; style its message part). | — |
toggle | aria-pressed ). | — |
meter | feedback ). | empty, weak, medium, strong |
meter-segment | — | |
strength | — |
Accessibility
- The control is a native
<input type="password">named by a real<label for>; it switches totype="text"while revealed. - The show/hide control is a
<button>with a constant name ("Show password" by default) whosearia-pressedtells whether the password is shown. While revealed, the field turns off auto-capitalization, autocorrect and spell-check. - The strength text sits in an
aria-live="polite"region, so screen readers announce changes while typing; the coloured bars are hidden from assistive technology. - Hint, disabled reason and error are linked through
aria-describedby; a touched, invalid field setsaria-invalid="true". autocompletedefaults tocurrent-password, ornew-passwordwithfeedback, so browsers and password managers can help users (WCAG 1.3.5); set it yourself for other cases. The label floats when the browser autofills the field.
API
Password
vig-password| Name | Type | Default | Description |
|---|---|---|---|
autocomplete | string | undefined | undefined | Native |
dirty | boolean | false | — |
disabled | boolean | false | — |
disabledReasons | readonly WithOptionalFieldTree<DisabledReason>[] | [] | — |
errorMessages | Record<string, string> | — | — |
errors | readonly ValidationError.WithOptionalFieldTree[] | [] | — |
feedback | boolean | false | Show the strength meter under the field. |
hidden | boolean | false | — |
hideLabel | boolean | false | Visually hides the label — it still names the control for assistive tech — and drops the row reserved for it, giving a shorter control for dense toolbars such as table filters. Pair it with a placeholder. |
hidePasswordAriaLabel | string | undefined | undefined | Deprecated: The reveal toggle keeps one name (`showPasswordAriaLabel`) and exposes its state through `aria-pressed`, so this label is no longer rendered. Removed in the next major. — |
hint | string | undefined | undefined | — |
invalid | boolean | false | — |
label | string | — | — |
labelPosition | LabelPosition | 'float' |
|
maxLength | number | undefined | undefined | — |
mediumLabel | string | undefined | undefined | — |
mediumRegex | — | MEDIUM_REGEX | Deprecated: Use the `strength` function input. A regex source rating `medium`; ignored when `strength` is set. — |
minLength | number | undefined | undefined | — |
name | string | '' | — |
pending | boolean | false | — |
placeholder | string | undefined | undefined | — |
promptLabel | string | undefined | undefined | — |
readonly | boolean | false | — |
required | boolean | false | — |
showPasswordAriaLabel | string | undefined | undefined | Name of the reveal toggle. It stays the same in both states — the
toggle's |
size | FieldSize | 'md' | — |
strength | PasswordStrengthFn | undefined | undefined | Rates the password for the meter (template name |
strongLabel | string | undefined | undefined | — |
strongRegex | — | STRONG_REGEX | Deprecated: Use the `strength` function input. A regex source rating `strong`; ignored when `strength` is set. — |
toggleMask | boolean | true | Show the eye button that reveals the password. |
touched | boolean | false | — |
value | string | '' | — |
weakLabel | string | undefined | undefined | — |
| Name | Payload | Description |
|---|---|---|
touch | void | — |
valueChange | string | — |
| Signature | Description |
|---|---|
focus(options?: FocusOptions): void | Moves focus to the control's interactive element (the input, or the
trigger of a popup control). Signal Forms calls it through
|
reset(): void | Returns the control to its pristine look: drops in-progress text, closes
an open popup, clears errors the component raised itself and the
submitted state of |
VigValueAccessor
Bridges the vigdx form fields to Reactive Forms (formControl,
formControlName) and template-driven forms (ngModel). Import it next to
the component; Signal Forms ([formField]) need no accessor.
| Signature | Description |
|---|---|
registerOnChange(fn: (value: unknown) => void): void | — |
registerOnTouched(fn: () => void): void | — |
setDisabledState(disabled: boolean): void | — |
writeValue(value: unknown): void | — |