Skip to content

Date โ€‹

A rich date / datetime / time picker built on flatpickr. Set type to date (default), datetime, or time. The common flatpickr options are exposed as named props, and the options prop passes through any other flatpickr option โ€” so the picker is completely featured.

model-value is the formatted string (flatpickr's dateStr); the mno-change event also carries the raw Date[] in detail.dates. It shares mono-input's look: sizes, colors, variants, validation, clearable, cssClass, and the width/height sizing props.

Basic โ€‹

Default date picker with label, placeholder, and value binding.

Vue SFC

Sizes โ€‹

The size prop scales the field from xs to xxl โ€” the same scale as the other form controls, defaulting to md.

Vue SFC

Variants โ€‹

outlined (default), filled and underlined โ€” the same three field styles as <mono-input>. Pick a color to see the variant and color combine: outlined = colored border, filled = colored tint, underlined = colored underline.

underlined focuses with a soft glow under the line rather than a ring around the field โ€” tune it with --mono-date-underline-glow (default 0 5px 6px -6px).

Vue SFC

Colors โ€‹

Every built-in color (primary / secondary / success / danger / warning / info) tints the field's resting border, focus ring and calendar accent โ€” identical to the other form-control palettes.

Vue SFC

States โ€‹

disabled (no open, no selection), readonly (display only), and required (a * next to the label).

Vue SFC

Validation โ€‹

validation-state โ€” error or success (mono-date has no warning/invalid state) โ€” with a validation-message. The error / success booleans + error-message / success-message work too.

Vue SFC

Clearable โ€‹

With clearable, a clear (โœ•) button appears whenever a date is selected.

Vue SFC

Datetime โ€‹

type="datetime" adds a time picker beside the calendar.

Vue SFC

Time โ€‹

type="time" is a time-only picker (no calendar). time-24hr switches to 24-hour mode.

Vue SFC

Range โ€‹

mode="range" lets the user pick a start and end date.

Vue SFC

Inline โ€‹

inline renders the calendar always-visible, without a popup.

Vue SFC

Typeable โ€‹

typeable lets the user type into the field. mono-date live-parses as you type โ€” the calendar navigates to the value and auto-selects it once a complete date (in dateFormat) is entered.

Vue SFC

Options passthrough โ€‹

Pass any flatpickr option via the options prop (here: week numbers, a custom dateFormat, and minDate).

Vue SFC

Customized โ€‹

The cssClass prop appends a class to each field part (root / label / field / native / message).

Vue SFC

CSS Variables โ€‹

Vue SFC

Themed through --mono-date-* custom properties (they inherit and pierce the shadow boundary); an explicit --mono-date-primary override wins over the color prop. Re-skin globally via the --theme-* tokens.

VariableDefaultControls
--mono-date-primary--theme-primaryField focus + calendar accent (set by color)
--mono-date-primary-rgbprimary rgbFocus ring / calendar accent (as r, g, b)
--mono-date-underline-glow0 5px 6px -6pxUnderlined focus glow geometry
--mono-date-text--theme-textField text color
--mono-date-mutedtext 55%Placeholder / icon color
--mono-date-border--theme-borderField border color
--mono-date-surface--theme-surfaceField background
--mono-date-danger--theme-dangerError-state color
--mono-date-success--theme-successSuccess-state color

Types โ€‹

Importimport { DateProps } from 'mono-helper'
PropValueDefaultDescription
type'date' | 'datetime' | 'time'โ€”Picker mode: `date` (default), `datetime`, or `time`.
modelValuestringโ€”Selected value as a formatted string (two-way bound).
valuestringโ€”โ€”
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'โ€”Visual size / color / variant (mirror mono-input).
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info'โ€”โ€”
variant'underlined' | 'outlined' | 'filled'โ€”โ€”
labelstringโ€”Field label + helper / validation messaging.
placeholderstringโ€”โ€”
helperTextstringโ€”โ€”
validationState'success' | 'default' | 'error'โ€”โ€”
validationMessagestringโ€”โ€”
errorbooleanโ€”โ€”
errorMessagestringโ€”โ€”
successbooleanโ€”โ€”
successMessagestringโ€”โ€”
disabledbooleanโ€”State flags.
readonlybooleanโ€”โ€”
requiredbooleanโ€”โ€”
clearablebooleanโ€”โ€”
ariaLabelTextstringโ€”โ€”
dateFormatstringโ€”Output/parsing format, e.g. `"Y-m-d"`, `"d M Y"`, `"H:i"`.
altInputbooleanโ€”Show a second, human-readable input while submitting `dateFormat`.
altFormatstringโ€”โ€”
typeablebooleanโ€”Let the user type into the input directly. Beyond flatpickr's Enter/blur parsing, mono-date live-parses as you type: the calendar navigates to the value and auto-selects it once a complete date (matching `dateFormat`) is entered. Best used without `altInput`.
clickOpensbooleanโ€”Open the calendar on input click (default true).
defaultDatestring | number | Date | (string | number | Date)[]โ€”โ€”
minDatestring | number | Dateโ€”โ€”
maxDatestring | number | Dateโ€”โ€”
disableDateLimit<DateOption>[]โ€”Dates to disable (values, ranges, or predicate fns).
enableDateLimit<DateOption>[]โ€”Whitelist of selectable dates (everything else disabled).
mode'single' | 'multiple' | 'range'โ€”โ€”
enableSecondsbooleanโ€”โ€”
time24hrbooleanโ€”24-hour time (flatpickr `time_24hr`).
hourIncrementnumberโ€”โ€”
minuteIncrementnumberโ€”โ€”
defaultHournumberโ€”โ€”
defaultMinutenumberโ€”โ€”
inlinebooleanโ€”Render the calendar inline (always visible).
weekNumbersbooleanโ€”โ€”
monthSelectorType'static' | 'dropdown'โ€”โ€”
shorthandCurrentMonthbooleanโ€”โ€”
position'auto' | 'above' | 'below' | 'auto left' | 'auto center' | 'auto right' | 'above left' | 'above center' | 'above right' | 'below left' | 'below center' | 'below right' | (self: Instance, customElement: HTMLElement | undefined) => voidโ€”โ€”
ariaDateFormatstringโ€”โ€”
locale'default' | 'ar' | 'at' | 'az' | 'be' | 'bg' | 'bn' | 'bs' | 'ca' | 'cat' | 'ckb' | 'cs' | 'cy' | 'da' | 'de' | 'en' | 'eo' | 'es' | 'et' | 'fa' | 'fi' | 'fo' | 'fr' | 'gr' | 'he' | 'hi' | 'hr' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'ko' | 'km' | 'kz' | 'lt' | 'lv' | 'mk' | 'mn' | 'ms' | 'my' | 'nl' | 'nn' | 'no' | 'pa' | 'pl' | 'pt' | 'ro' | 'ru' | 'si' | 'sk' | 'sl' | 'sq' | 'sr' | 'sv' | 'th' | 'tr' | 'uk' | 'vn' | 'zh' | 'uz' | 'uz_latn' | 'zh_tw' | Partial<CustomLocale>โ€”flatpickr locale key or object.
optionsPartial<Partial<BaseOptions>>โ€”Escape hatch โ€” any other flatpickr option, merged into the config. Lets you use the full flatpickr feature set beyond the named props above.
widthstring | numberโ€”Explicit sizing (CSS string or number โ†’ px). Use `width="100%"` for full width.
heightstring | numberโ€”โ€”
minWidthstring | numberโ€”โ€”
maxWidthstring | numberโ€”โ€”
minHeightstring | numberโ€”โ€”
maxHeightstring | numberโ€”โ€”
cssClassDateCssClassโ€”Per-part class overrides.
visiblebooleanโ€”Whether the control is shown. Defaults to `true`.
visibleType'invisible' | 'none'โ€”How it hides when `visible` is `false`. Defaults to `'none'`.