Date Input
Masked text input for typing dates and times, with automatic formatting, min and max limits, and validation.
import { DateInput } from "@plexui/vue/components/DateInput";On Phone, put a date input in a row of a FieldGroup, as the Input examples and the Settings Forms do. The row is its frame and sets its height, insets and type, so the Phone previews show rows without the variant, size and pill controls. To pick a date rather than type it, use the compact date of a Date Picker in the row.
Examples
Overview
With time
With seconds
Limits
US format
ISO format
With Field
Enter your date of birth
Validation
Date is required
API
| Prop | Type | Default | Description |
|---|---|---|---|
value / v-model:value | DateTime | null | — | Selected date (Luxon DateTime). The field shows its date and time in its own zone, and a typed date is made in that zone (Luxon's default zone without a value) |
@update:value | (date: DateTime | null) => void | — | Emitted when a complete valid date is entered or the field is cleared |
@change | (date: DateTime | null) => void | — | Same payload as update:value, named after React's onChange |
mode | MaskitoDateMode | "dd/mm/yyyy" | Date format mode: dd/mm/yyyy, mm/dd/yyyy, yyyy/mm/dd, etc. |
separator | string | "." | Character between date parts |
time-mode | MaskitoTimeMode | — | Enable time input: HH:MM, HH:MM:SS, etc. |
date-time-separator | string | ", " | Separator between date and time parts |
time-step | number | 0 | Arrow-key increment step for time segments |
min | DateTime | — | Earliest allowed date |
max | DateTime | — | Latest allowed date |
clearable | boolean | false | Show clear button when input has a value |
size | ControlSize | "md" | Input size (3xs to 3xl) |
variant | "outline" | "soft" | "outline" | Visual style |
pill | boolean | false | Fully rounded corners |
disabled | boolean | false | Disable input |
invalid | boolean | false | Mark as invalid |
placeholder | string | — | Generated from the format if not set |
Other attributes, listeners and the startAdornment / endAdornment slots go to the underlying Input. The mask is Maskito (@maskito/vue), with the same options as the React component.
Styling
Date Input reads these component tokens. Override them at any scope to restyle it:
--input-border-color-invalid: border color invalid (defaultvar(--color-border-danger-outline))--input-gap-lg: gap lg (default10px)--input-gap-md: gap md (default8px)--input-gap-sm: gap sm (default6px)--input-gap-xs: gap xs (default4px)--input-outline-border-color: outline border color (defaultvar(--color-border-primary-outline))--input-outline-border-color-focus: outline border color focus (defaultvar(--alpha-50))--input-outline-border-color-hover: outline border color hover (defaultlight-dark(var(--alpha-25), var(--alpha-30)))--input-placeholder-text-color: placeholder text color (defaultvar(--color-text-tertiary))--input-soft-background-color: soft background color (defaultvar(--color-background-primary-soft-alpha))--input-soft-border-color-focus: soft border color focus (defaultvar(--alpha-20))--input-text-color: text color (defaultvar(--color-text))