DatePickerField

Form & Input
stable

Text field with a built-in calendar dropdown. Combines OrigamTextField and OrigamDatePicker into a single form control with chip display for multiple/range selections.

Preview

Rendering the live preview…

single

Rendering the live preview…

range

Rendering the live preview…

multiple

Rendering the live preview…

clearable

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamDatePickerFieldSchematic of the DatePickerField component with numbered internal parts. 1 origam-date-picker-field DD / MM / YYYY 📅 2 3 OrigamDatePicker (calendar grid) ① = text-field chrome. ② = appendInner calendar icon. ③ = DatePicker dropdown (OrigamMenu).
Anatomy of <origam-date-picker-field>. The component combines an OrigamTextField chrome ① with a calendar toggle icon ② that opens an OrigamMenu containing OrigamDatePicker ③.
1.origam-date-picker-field (TextField root)
TextField chrome — label, border, density, variant. The selected date(s) appear as formatted text or chips inside the control area. Extends all ITextFieldProps.
2appendInner — calendar toggle icon
Calendar icon rendered in the appendInner slot by default (mdi-calendar). Clicking it toggles the menu open/closed. aria-label comes from openText/closeText props.
3OrigamMenu + OrigamDatePicker
Floating menu (OrigamMenu) containing the full OrigamDatePicker. Positioned below the field with an offset from --origam-date-picker-field---menu-offset. Content class: origam-date-picker-field__content.

API

Props

All props accepted by this component, with their type, default value and description.

menu
boolean
false
Controls whether the calendar dropdown is open (v-model:menu).
menuProps
IMenuProps
Props forwarded to the underlying OrigamMenu used to float the DatePicker.
range
boolean
false
Enables date-range mode. The field accepts two dates (start/end) and displays them as chips.
multiple
boolean
false
Enables multi-date selection. Each selected date is displayed as a chip inside the field.
openOnClear
boolean
false
Reopens the calendar dropdown when the clear button is clicked.
closeText
string
Accessible label for the close/calendar toggle icon button.
openText
string
Accessible label for the open/calendar toggle icon button.
closeOnSelect
boolean
true
Closes the calendar dropdown automatically after a date is selected. Disabled for range and multiple modes.
chipProps
IChipProps
Props forwarded to each OrigamChip that represents a selected date in multiple/range mode.
closableChips
boolean
false
Adds a close icon on each chip to allow removing individual dates in multiple/range mode.
autofocus
boolean
counter
boolean | number | string
counterValue
number | ((e: any) => number)
placeholder
string
Placeholder text shown when no date is selected.
persistentPlaceholder
boolean
persistentCounter
boolean
role
string
type
TTextFieldType
modelModifiers
string | boolean
mask
TMask
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
Active/focused colour and calendar selection colour.
density
'default'
Field vertical density.
centerAffix
boolean
dirty
boolean
disabled
boolean
false
Disables the field and prevents the calendar from opening.
error
string | boolean
false
Forces the error visual state on the field.
inline
boolean
label
string
Field label text.
prefix
string
suffix
string
persistentClear
boolean
singleLine
boolean
required
boolean
loading
TControlLoadingValue
tag
string
loadingText
string
bgColor
TColor
appendInnerAvatar
string
appendInnerIcon
'mdi-calendar'
Icon inside the field, after the value. Defaults to mdi-calendar (calendar toggle).
prependInnerAvatar
string
prependInnerIcon
Icon inside the field, before the value.
clearIcon
TIcon
clearable
boolean
false
Shows a clear icon button to reset the selected date(s).
prependInnerAriaLabel
string
appendInnerAriaLabel
string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
focused
boolean
text
string
floating
boolean
name
string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight
letterSpacing
TLetterSpacing
active
boolean | IStateEffectConfig
activeClass
string
variant
'outlined'
TextField visual style variant (outlined, filled, underlined, solo…).
elevation
TElevation
size
TSize | number
hideDetails
boolean | string
hideSpinButtons
boolean
hint
string
Helper text shown below the field.
persistentHint
boolean
messages
Array<string> | string
height
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
direction
TDirection
errorMessages
Array<string> | string
maxErrors
number | string
readonly
boolean
false
Makes the field non-interactive without visually disabling it.
rules
Array<any>
modelValue
any
Selected date(s). Single value for single mode; array for multiple or range mode.
validateOn
TValidateOn
validationValue
any
appendAvatar
string
appendIcon
Icon appended after the field.
prependAvatar
string
prependIcon
Icon prepended before the field.
prependAriaLabel
string
appendAriaLabel
string
transition
boolean | string | TTransitionProps

API

Slots

Content slots exposed by this component.

#rangeSelection
Custom renderer for the range selection display. Receives the start and end date.
#chip
#selection
Custom renderer for each selected date. Replaces the default chip/text display.
#label
Custom label.
#clear
Custom clear button replacing the default × icon.
#prependInner
Content inside the field before the value.
#appendInner
Content inside the field after the value (defaults to calendar toggle icon).
#loader
Custom loader shown while loading=true.
#floatingLabel
Custom floating label.
#prefix
Text prefix displayed inside the field before the value.
#suffix
Text suffix displayed inside the field after the value.
#prepend
Content before the field (outside the border).
#append
Content after the field (outside the border).

API

Emits

Events emitted by this component.

@update:menu
boolean
Fired when the calendar dropdown opens or closes.
@update:modelValue
any
Fired when the selected date(s) change.
@focus
FocusEvent
Fired when the field receives focus.
@blur
FocusEvent
Fired when the field loses focus.
@click:clear
MouseEvent
Fired when the clear button is clicked.

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props.
Ref<boolean>
Whether the field is currently focused.
Ref<boolean>
Whether the calendar dropdown is currently open.
Ref<string>
Reactive CSS string for the injected style sheet.
string
Unique style-sheet ID for this instance.
() => void
Injects the style sheet into the document.
() => void
Removes the style sheet from the document.
Ref<boolean>
True once the style sheet has been injected.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Minimum field width.
Maximum field width.
Vertical gap between the field bottom and the calendar dropdown.
Default colour of the calendar toggle icon.
Icon colour on hover.
Icon colour in error state.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

combobox
dialog

Keyboard interactions

Keyboard interactions
KeyAction
Enter / Space (on field)Opens the calendar dropdown.
EscapeCloses the calendar dropdown and returns focus to the field.
TabMoves focus between the field, calendar navigation and days.

Notes

  • The field sets aria-haspopup="datepickerbox" on the inner input to signal that activating it opens a date picker. The calendar dropdown uses role="dialog" with aria-modal="true" when open.
  • The field must have a label (via the label prop or an external aria-label). Without a label, the calendar toggle icon is not accessible.
  • In multiple/range mode, each chip has aria-label with the formatted date. Closable chips have an aria-label on the close button ("Remove date X").

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Basic date field

vue

Date range field

vue

Multiple dates

vue