Skip to content

Component PasswordInput

MeowLynxSea edited this page Jan 25, 2026 · 5 revisions

PasswordInput

A password input field.

This component provides a secure text input experience (masking characters) and standard editing behavior.

Example

use gpui::ElementId;
use yororen_ui::component::password_input;

let view = password_input()
    .key(("settings", "password"))
    .placeholder("Password")
    .on_change(|value, _window, _cx| {
        // ...
    });

When to use

  • Password fields and secret inputs

API

  • password_input(): constructor
  • id(...) / key(...): stable identity
  • placeholder("...")
  • disabled(bool)
  • allow_copy(bool): allow copying selected text to clipboard (default: false)
  • allow_cut(bool): allow cutting selected text to clipboard (default: false)
  • on_change(|value, window, cx| ...): fired on content change
  • Styling: bg/border/focus_border/text_color/height

Defaults

  • Height: 36px
  • Placeholder: empty string

Notes

  • Requires one-time registration via yororen_ui::component::init(cx).
  • By default, copy/cut are disabled to reduce the risk of accidentally leaking secrets via the clipboard.

Clone this wiki locally