Date Time Picker Styling
Style Variants
The following style variants can be applied:
| Variant | Description | Supported by |
|---|---|---|
| Aligns the text to the left side of the field (default) | Aura, Lumo |
| Centers the text within the field | Aura, Lumo |
| Aligns the text to the right side of the field. Recommended for numerical values when presented in vertical groups. | Aura, Lumo |
| Aligns the text to the start side of the field, taking into account the current text direction (left for LTR, right for RTL) | Aura |
| Aligns the text to the end side of the field, taking into account the current text direction (right for LTR, left for RTL) | Aura |
| Renders a more compact field | Aura, Lumo |
| Renders the helper above the field, and below the label | Aura, Lumo |
Source code
DateTimePickerStyles.java
date-time-picker-styles.tsx
date-time-picker-styles.ts
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 Component Style Properties for more information on style properties.
| Property | Supported by |
|---|---|
| Aura |
Animation
The overlay has a built-in opening and closing animation, which is disabled until an animation
duration is set. The closed properties define the state that the overlay animates from when it
opens, and to when it closes. The Aura theme sets these properties for some components. Lumo has its
own overlay animations, which these properties don’t affect.
While an animation runs, the component has the opening or closing state attribute, so separate
values can be applied to each direction. The backdrop always fades, and only the opacity is animated
when the user prefers reduced motion.
| Property | Value syntax | Initial value |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note
|
These properties are set on the sub-fields, vaadin-date-time-picker > vaadin-date-picker and
vaadin-date-time-picker > vaadin-time-picker, not on the vaadin-date-time-picker root element.
|
Label
| Property | Supported by |
|---|---|
| Lumo |
| Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
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.
|
Important
|
Not for Shadow DOM
These selectors should be used in styles.css or another stylesheet loaded with the @StyleSheet annotation or the @import CSS rule.
They do not work in the shadow DOM of Vaadin components, such as in stylesheets in the components sub-folder or loaded with the @CssImport annotation’s themeFor property.
|
- Root element
-
vaadin-date-time-picker
States
- Required
-
vaadin-date-time-picker[required] - Focused
-
vaadin-date-time-picker[focused] - Keyboard focused
-
vaadin-date-time-picker[focus-ring] - Read-only
-
vaadin-date-time-picker[readonly] - Disabled
-
vaadin-date-time-picker[disabled] - Not empty
-
vaadin-date-time-picker[has-value] - Hovered
-
vaadin-date-time-picker:hover
Sub-Fields
- Date Picker
-
vaadin-date-time-picker> vaadin-date-picker - Time Picker
-
vaadin-date-time-picker> vaadin-time-picker
See Date Picker and Time Picker selectors for details
Label
- Field with label
-
vaadin-date-time-picker[has-label] - Label
-
vaadin-date-time-picker::part(label) - Label text
-
vaadin-date-time-picker> label - Required indicator
-
vaadin-date-time-picker::part(required-indicator)
Helper and Validation Error
- Field with helper
-
vaadin-date-time-picker[has-helper] - Helper
-
vaadin-date-time-picker::part(helper-text) - Helper text
-
vaadin-date-time-picker> [slot="helper"] - Invalid field
-
vaadin-date-time-picker[invalid] - Field with error message
-
vaadin-date-time-picker[has-error-message] - Error message
-
vaadin-date-time-picker::part(error-message) - Error message text
-
vaadin-date-time-picker> [slot="error-message"]