Password Input
Un campo de contraseña con un botón para mostrarla u ocultarla, como control de formulario.
Disponible en
Angular: disponible Vue: disponible React: disponible React Native: disponible
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>Importación
import {
SonePasswordInputComponent,
} from "@surface-one/angular/password-input";Referencia de la 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`.
| Nombre | Tipo | Predeterminado |
|---|---|---|
valuebidireccional | string | "" |
visiblebidireccionalShows 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` |