Docs

Documentation versions (currently viewingVaadin 25 (prerelease))

Date Time Picker Styling

Styling API reference for the Date Time Picker component.

Style Variants

The following style variants can be applied:

Variant Description Supported by

align-left

Aligns the text to the left side of the field (default)

Aura, Lumo

align-center

Centers the text within the field

Lumo

align-right

Aligns the text to the right side of the field. Recommended for numerical values when presented in vertical groups.

Aura, Lumo

align-start

Aligns the text to the start side of the field, taking into account the current text direction (left for LTR, right for RTL)

Aura

align-end

Aligns the text to the end side of the field, taking into account the current text direction (right for LTR, left for RTL)

Aura

small

Renders a more compact field

Lumo

helper-above-field

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

--vaadin-date-time-picker-gap

Aura

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-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"]