Skip to main content

Password

Password widgetPassword widget

Text input rendered as a mask - in the editor, on the panel row and in the summary; the accepted value stays plain for the consumer.

$p->password('api_key', 'API key');

Two opt-in options, both off by default so the behaviour above is unchanged:

  • revealable() adds a reveal toggle. Press Tab in the editor to cycle the display between hidden (nothing shown), masked and plaintext. This only changes what is drawn - the stored value is never affected, and the panel row and summary stay masked.
  • confirmation() prompts for the value a second time and rejects a mismatch with a clear message before accepting.
$p->password('api_key', 'API key')->revealable()->confirmation();
ANSINo ANSI
UnicodePassword: Unicode + ANSIPassword: Unicode + ANSIPassword: Unicode + No ANSIPassword: Unicode + No ANSI
ASCIIPassword: ASCII + ANSIPassword: ASCII + ANSIPassword: ASCII + No ANSIPassword: ASCII + No ANSI

With revealable() on, Tab cycles the editor's display through hidden, masked and plaintext, and the hint line shows the toggle:

Password reveal toggle: the value shown as plaintext with a tab reveal hintPassword reveal toggle: the value shown as plaintext with a tab reveal hint