Select
- 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 |
|
|
Background, disabled |
|
|
Border width |
|
|
Border color |
|
|
Hover highlight opacity |
|
|
Height |
|
|
Value text color |
|
|
Value text color, disabled |
|
|
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-select
States
- Required
-
vaadin-select
[required] - Focused
-
vaadin-select
[focused] - Keyboard focused
-
vaadin-select
[focus-ring] - Read-only
-
vaadin-select
[readonly] - Disabled
-
vaadin-select
[disabled] - Not empty
-
vaadin-select
[has-value] - With open overlay
-
vaadin-select
[opened] - Hovered
-
vaadin-select
:hover
Field
- Field surface (background, border)
-
vaadin-select
::part(input-field) - Internal button element
-
vaadin-select-value-button
- Selected item element inside field
-
vaadin-select-value-button
> vaadin-select-item - Selected value
-
vaadin-select-value-button
> vaadin-select-item::part(content) - Internal button showing placeholder
-
vaadin-select-value-button
[placeholder] - Toggle Button
-
vaadin-select
::part(toggle-button) - Prefix element
-
vaadin-select
> [slot="prefix"] - Read-only border
-
vaadin-select
::part(input-field)::after
Label
- Field with label
-
vaadin-select
[has-label] - Label
-
vaadin-select
::part(label) - Label text
-
vaadin-select
> label - Required indicator
-
vaadin-select
::part(required-indicator)
Helper and Validation Error
- Field with helper
-
vaadin-select
[has-helper] - Helper
-
vaadin-select
::part(helper-text) - Helper text
-
vaadin-select
> [slot="helper"] - Invalid field
-
vaadin-select
[invalid] - Error message
-
vaadin-select
::part(error-message) - Error message text
-
vaadin-select
> [slot="error-message"]
Overlay
- Overlay element
-
vaadin-select-overlay
- Overlay background
-
vaadin-select-overlay
::part(overlay) - Overlay list box wrapper
-
vaadin-select-overlay
::part(content)
Items
- Item element
-
vaadin-select-item
- Selected item
-
vaadin-select-item
[selected] - Item selection indicator
-
vaadin-select-item
::part(checkmark) - Item selection indicator icon
-
vaadin-select-item
::part(checkmark)::before - Focused item
-
vaadin-select-item
[focused] - Item content wrapper
-
vaadin-select-item
::part(content) - Hovered item
-
vaadin-select-item
:hover