Aller au contenu

Composants

Champ de mot de passe

Un champ de mot de passe avec un bouton d’affichage.

Utilisation

Basique

HTML
<bs:bsui-password-input placeholder="Your password" />

Définir et confirmer

La paire habituelle, avec un libellé et un nom de champ de formulaire pour chacun.

HTML
<bs:bsui-stack direction="column" gap="4" align="stretch">
  <bs:bsui-field>
    <bs:bsui-field-label text="New password" />
    <bs:bsui-password-input name="password" placeholder="At least 12 characters" />
  </bs:bsui-field>
  <bs:bsui-field>
    <bs:bsui-field-label text="Confirm password" />
    <bs:bsui-password-input name="password_confirm" placeholder="Repeat it" />
  </bs:bsui-field>
</bs:bsui-stack>

Saisie non valide

Un champ non valide colore le contrôle et affiche le message d’erreur.

Use at least 12 characters and one number.
HTML
<bs:bsui-field invalid="true">
  <bs:bsui-field-label text="Password" />
  <bs:bsui-password-input placeholder="Enter password" />
  <bs:bsui-field-error text="Use at least 12 characters and one number." />
</bs:bsui-field>

Désactivé

Le bouton d’affichage est verrouillé avec le champ.

HTML
<bs:bsui-password-input placeholder="Managed by your identity provider" disabled="true" />

Attributs

AttributTypePar défaut
name text —
placeholder text Enter password
disabled toggle false
nameAlt text —
onChange text —
value text —
inputId text —
ariaLabel text —
autocomplete text —