Password Input
Um campo de palavra-passe com um botão mostrar / ocultar, como controlo de formulário.
Disponível em
Angular: disponível Vue: disponível React: disponível React Native: disponível
Uso
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>Importação
import {
SonePasswordInputComponent,
} from "@surface-one/angular/password-input";Referência da 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 | Padrão |
|---|---|---|
valuebidirecional | string | "" |
visiblebidirecionalShows 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` |