Password Input
Un campo password con un interruttore mostra / nascondi, come controllo di modulo.
Disponibile in
Angular: disponibile Vue: disponibile React: disponibile React Native: disponibile
Utilizzo
Other devices are signed out after the change.
<div class="demo-stack" style="max-width: 24rem">
<div soneField>
<label soneFieldLabel for="demo-current-password">Current password</label>
<sone-password-input inputId="demo-current-password" [(value)]="current" />
</div>
<div soneField [invalid]="tooShort()">
<label soneFieldLabel for="demo-new-password">New password</label>
<sone-password-input inputId="demo-new-password" autocomplete="new-password"
placeholder="At least 8 characters" [(value)]="next" [invalid]="tooShort()" />
@if (tooShort()) {
<p soneFieldError>Use at least 8 characters.</p>
} @else {
<p soneFieldDescription>Other devices are signed out after the change.</p>
}
</div>
</div>Importazione
import {
SonePasswordInputComponent,
} from "@surface-one/angular/password-input";Riferimento API
SonePasswordInputComponentComponente
A password field with a show / hide toggle, on the Input Group. The toggle is a toggle button: a constant name ("Show password") and `aria-pressed`.
| Nome | Tipo | Predefinito |
|---|---|---|
valuebidirezionale | string | "" |
visiblebidirezionaleShows the password as plain text (`[(visible)]`). | boolean | false |
autocomplete | PasswordAutocomplete | "current-password" |
placeholder | string | "" |
inputId | string | null | null |
name | string | null | null |
ariaLabel | string | null | null |
ariaDescribedbyExtra ids for `aria-describedby` on the input. | string | null | null |
invalid | boolean | false |
disabled | boolean | false |
readonly | boolean | false |
toggleLabelThe toggle's accessible name; its state is `aria-pressed`. | — | $localize`Show password` |