Documentation versions (currently viewingVaadin 8)

Vaadin 8 reached End of Life on February 21, 2022. Discover how to make your Vaadin 8 app futureproof →


The PasswordField is a variant of TextField that hides the typed input from visual inspection.

PasswordField tf = new PasswordField("Keep it secret");

The result is shown in PasswordField.

passwordfield basic

You should note that the PasswordField hides the input only from "over the shoulder" visual observation. Unless the server connection is encrypted with a secure connection, such as HTTPS, the input is transmitted in clear text and may be intercepted by anyone with low-level access to the network. Also phishing attacks that intercept the input in the browser may be possible by exploiting JavaScript execution security holes in the browser.

CSS Style Rules

.v-textfield { }

The PasswordField does not have its own CSS style name but uses the same v-textfield style as the regular TextField. See "CSS Style Rules" for information on styling it.