Password Field
- Usage
- Styling
Style Properties
The following style properties can be used in CSS stylesheets to customize the appearance of this component.
To apply values to these properties globally in your application UI, place them in a CSS block using the html {…}
selector.
See Lumo Style Properties for more information on style properties.
Note
|
Input Field Components Shared Styles
Style properties whose names start with --vaadin-input-field are shared among all input field components. To apply them only to a specific type of component, use an element selector like vaadin-text-field {…}
|
Field Surface
Feature | Property | Default Value |
---|---|---|
Background |
|
|
Background, invalid |
|
|
Background, hover highlight color |
|
|
Background, invalid hover highlight color |
|
|
Border width |
|
|
Border color |
|
|
Hover highlight opacity |
|
|
Height |
|
|
Value text color |
|
|
Value font size |
|
|
Value font weight |
|
|
Placeholder text color |
|
|
Border radius |
|
|
Read-only border |
|
|
Label
Feature | Property | Default Value |
---|---|---|
Color |
|
|
Focused color |
|
|
Hovered color |
|
|
Font size |
|
|
Font weight |
|
|
Helper
Feature | Property | Default Value |
---|---|---|
Font size |
|
|
Font weight |
|
|
Color |
|
|
Top margin |
|
|
CSS Selectors
The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.
- Root element
-
vaadin-password-field
States
- Required
-
vaadin-password-field
[required] - Focused
-
vaadin-password-field
[focused] - Keyboard focused
-
vaadin-password-field
[focus-ring] - Read-only
-
vaadin-password-field
[readonly] - Disabled
-
vaadin-password-field
[disabled] - Not empty
-
vaadin-password-field
[has-value] - Hovered
-
vaadin-password-field
:hover - Password visible
-
vaadin-password-field
[password-visible] - Password masked
-
vaadin-password-field
:not([password-visible])
Field
- Field surface (background, border)
-
vaadin-password-field
::part(input-field) - Native input element
-
vaadin-password-field
> input - Input field with placeholder shown
-
vaadin-password-field
> input:placeholder-shown - Clear button
-
vaadin-password-field
::part(clear-button) - Clear button icon
-
vaadin-password-field
::part(clear-button)::before - Prefix element
-
vaadin-password-field
> [slot="prefix"] - Suffix element
-
vaadin-password-field
> [slot="suffix"] - Reveal button
-
vaadin-password-field
::part(reveal-button) - Reveal button icon
-
vaadin-password-field
::part(reveal-button)::before - Read-only border
-
vaadin-password-field
::part(input-field)::after
Label
- Field with label
-
vaadin-password-field
[has-label] - Label
-
vaadin-password-field
::part(label) - Label text
-
vaadin-password-field
> label - Required indicator
-
vaadin-password-field
::part(required-indicator)
Helper and Validation Error
- Field with helper
-
vaadin-password-field
[has-helper] - Helper
-
vaadin-password-field
::part(helper-text) - Helper text
-
vaadin-password-field
> [slot="helper"] - Invalid field
-
vaadin-password-field
[invalid] - Error message
-
vaadin-password-field
::part(error-message) - Error message text
-
vaadin-password-field
> [slot="error-message"]