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 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.

The field is Basecoat's .input-group with a leading icon (see Theme and Input); the calendar is flatpickr restyled in Basecoat's popover idiom β€” a --popover surface with a 1px --foreground/10 ring and an md shadow, --accent for hover / today / the range middle, --primary (or the color prop's role token) for the selected day. Dark mode is built in, calendar included.

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

Colors ​

Pick a colour and every variant takes it. Every built-in color sets the focus ring and the calendar's selected-day accent; a resting field is always on --input, like the other ported controls. primary focuses with --ring and selects with --primary.

outlined (default), filled and underlined β€” the same three field styles as <mono-input>. The variant and the colour combine: outlined = coloured border, filled = coloured tint, underlined = coloured underline. filled is luma's field (transparent border on an --input/50 surface) and underlined is sera's (square, bottom edge only, no ring).

Vue SFC

States ​

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

Vue SFC

Tooltip ​

When the extra explanation is too long for helper-text, put it behind an info icon at the end of the label. tooltip="…" takes plain text; :tooltip.prop="{ content, placement, color, … }" takes any tooltip option. The icon is keyboard-focusable and also works on a disabled field β€” a good place to say why it is disabled.

Plain text needs nothing extra

tooltip="…" (plain text) shows a small built-in bubble β€” no dependency. It sits above the icon (below when there's no room), stays on screen, and isn't clipped by an overflow: hidden parent. It reads the tooltip addon's --mono-tooltip-bg / -color / -radius / -max-width / -font-size / -padding-x / -padding-y knobs.

The object form is the tooltip addon (mono-tooltip: placement, color, delay…), which needs the optional peers pnpm add @floating-ui/dom @floating-ui/core. Without them an object-form tooltip renders no icon (and nothing is logged). Either way the icon only appears beside a label.

Vue SFC

Label position ​

label-position moves the label without touching its type or colours:

valuelook
topabove the box (default)
notchedoutlined: on the top border, ──Label──. filled / underlined: inset inside the top of the box, which grows by the label's line
left / rightbeside the box, centred on its first row; helper / validation messages stay under the box

Set it for every field at once with createMonoUI({ 'mono-date': { labelPosition: 'notched' } }). --mono-date-label-width fixes the side column so a stack of left fields lines up.

The notch is a background patch

The notch hides the border with --background. On a card or any other surface, set --mono-date-label-notch-bg to that surface (e.g. var(--card)).

Vue SFC

Validation position ​

validation-position decides where the validation message (error / success + validation-message) shows. The coloured border is the same in every mode.

valuelook
bottomthe row under the box (default) β€” the message replaces the helper text there
icona state icon inside the box; hover or tap it (or keyboard-focus the field) for the message in a state-coloured bubble
floatnothing until the field is hovered or focused; then the message floats under the box, and disappears again when you leave

In icon and float the row under the box keeps the helper text, and the message stays there for screen readers only. The bubbles need no dependency (no floating-ui). Knobs: --mono-validation-invalid-bg / -color (and warning / valid), --mono-validation-icon-size.

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. error is Basecoat's aria-invalid treatment: a permanent --destructive border and /20 ring, the label turns --destructive, the message carries role="alert".

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; the element copies the accent onto the body-level calendar as --cal-accent); an explicit --mono-date-primary override wins over the color prop. The field takes the same knobs as input, renamed --mono-date-*; re-skin globally via the tokens or switch flavor.

VariableDefaultControls
--mono-date-primary (+ --mono-date-primary-foreground)--ring / --primary-foreground (set by color)The accent: focus ring, and the calendar's selected day through --mono-date-calendar-accent
--mono-date-ring-color (alias --mono-date-focus-color) / -ring-width / -ring-alphathe accent / --mono-ring-width / --mono-ring-alphaFocus ring
--mono-date-border-color (aliases --mono-date-border, --mono-date-rest-border) / --mono-date-side-border-color--input / = borderResting border; the three non-bottom edges
--mono-date-bg (alias --mono-date-surface) / --mono-date-shadow--mono-mode-surface / --mono-shadow-xsField surface and shadow
--mono-date-radius / -radius-<size>, --mono-date-height-<size>, --mono-date-padding-x(-<size>), --mono-date-padding-y, --mono-date-font-<size>, --mono-date-line-height(-<size>), --mono-date-gapas inputGeometry and text
--mono-date-affix-padding / -affix-gap / -affix-icon-size2 / 1.5 / 4 Γ— --mono-spacingThe leading icon's inset, its gap to the text, its size
--mono-date-clear-radius, --mono-date-disabled-bg, --mono-date-readonly-bg, --mono-date-filled-bg, --mono-date-outline-*, --mono-date-label-*, --mono-date-message-*as inputClear button, state surfaces, variant knobs, label, message
--mono-date-color (alias --mono-date-text), --mono-date-placeholder, --mono-date-muted--foreground, --muted-foreground, --muted-foregroundText, placeholder, icon / message ink
--mono-date-danger / --mono-date-success--destructive / --successValidation colours
--mono-date-calendar-bg / -color / -radius / -shadow / -ring / -day-radius--popover / --popover-foreground / --mono-radius-md / --mono-shadow-md / 1px --foreground/10 / --mono-radius-mdThe calendar frame and its day cells

Deprecated and honoured as no-ops until 2.0: --mono-date-primary-rgb, --mono-date-underline-glow, --mono-date-soft, the per-colour filled tints.

Types ​

Importimport { DateProps } from '@mono-lit/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' | 'teal' | 'purple' | 'neutral' | 'dark'β€”β€”
variant'underlined' | 'outlined' | 'filled'β€”β€”
labelPosition'left' | 'right' | 'top' | 'notched'β€”Where the label sits: `top` (above the box, default), `notched` (on the top border for outlined; inset inside the box for filled / underlined), or `left` / `right` of the box. Knobs: `--mono-date-label-width`, `-label-side-gap`, `-label-notch-font-size`, `-label-notch-bg`.
validationPosition'bottom' | 'icon' | 'float'β€”Where the validation message shows. `bottom` (default): the row under the box. `icon`: a state icon inside the box; hover / tap / keyboard focus shows the message in a state-coloured bubble. `float`: the message floats under the box only while the field is hovered or focused. In `icon` / `float` the row under the box keeps the helper text.
labelstringβ€”Field label + helper / validation messaging.
placeholderstringβ€”β€”
helperTextstringβ€”β€”
tooltipstring | MonoTooltipOptionsβ€”Info icon at the end of the label; hovering, focusing or tapping it shows this text. Plain text β†’ a small built-in bubble (no dependency). Full tooltip options (`:tooltip.prop="{ content, placement, color }"`) β†’ a `mono-tooltip`, which needs the optional `@floating-ui/dom` + `@floating-ui/core` peers (without them that form renders no icon). Shown only beside a label.
validationState'success' | 'default' | 'error' | 'invalid' | 'valid'β€”β€”
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'none' | 'invisible'β€”How it hides when `visible` is `false`. Defaults to `'none'`.