DatePickerField
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…
singleRendering the live preview…
rangeRendering the live preview…
multipleRendering the live preview…
clearableStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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.
- menubooleanfalse
- Controls whether the calendar dropdown is open (v-model:menu).
- menuPropsIMenuProps
- Props forwarded to the underlying OrigamMenu used to float the DatePicker.
- rangebooleanfalse
- Enables date-range mode. The field accepts two dates (start/end) and displays them as chips.
- multiplebooleanfalse
- Enables multi-date selection. Each selected date is displayed as a chip inside the field.
- openOnClearbooleanfalse
- Reopens the calendar dropdown when the clear button is clicked.
- closeTextstring
- Accessible label for the close/calendar toggle icon button.
- openTextstring
- Accessible label for the open/calendar toggle icon button.
- closeOnSelectbooleantrue
- Closes the calendar dropdown automatically after a date is selected. Disabled for range and multiple modes.
- chipPropsIChipProps
- Props forwarded to each OrigamChip that represents a selected date in multiple/range mode.
- closableChipsbooleanfalse
- Adds a close icon on each chip to allow removing individual dates in multiple/range mode.
- autofocusboolean
- counterboolean | number | string
- counterValuenumber | ((e: any) => number)
- placeholderstring
- Placeholder text shown when no date is selected.
- persistentPlaceholderboolean
- persistentCounterboolean
- rolestring
- typeTTextFieldType
- modelModifiersstring | boolean
- maskTMask
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Active/focused colour and calendar selection colour.
- Field vertical density.
- centerAffixboolean
- dirtyboolean
- disabledbooleanfalse
- Disables the field and prevents the calendar from opening.
- errorstring | booleanfalse
- Forces the error visual state on the field.
- inlineboolean
- labelstring
- Field label text.
- prefixstring
- suffixstring
- persistentClearboolean
- singleLineboolean
- requiredboolean
- loadingTControlLoadingValue
- tagstring
- loadingTextstring
- bgColorTColor
- appendInnerAvatarstring
- Icon inside the field, after the value. Defaults to mdi-calendar (calendar toggle).
- prependInnerAvatarstring
- prependInnerIcon
- Icon inside the field, before the value.
- clearIconTIcon
- clearablebooleanfalse
- Shows a clear icon button to reset the selected date(s).
- prependInnerAriaLabelstring
- appendInnerAriaLabelstring
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- focusedboolean
- textstring
- floatingboolean
- namestring
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- letterSpacingTLetterSpacing
- activeboolean | IStateEffectConfig
- activeClassstring
- TextField visual style variant (outlined, filled, underlined, solo…).
- elevationTElevation
- sizeTSize | number
- hideDetailsboolean | string
- hideSpinButtonsboolean
- hintstring
- Helper text shown below the field.
- persistentHintboolean
- messagesArray<string> | string
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- directionTDirection
- errorMessagesArray<string> | string
- maxErrorsnumber | string
- readonlybooleanfalse
- Makes the field non-interactive without visually disabling it.
- rulesArray<any>
- modelValueany
- Selected date(s). Single value for single mode; array for multiple or range mode.
- validateOnTValidateOn
- validationValueany
- appendAvatarstring
- appendIcon
- Icon appended after the field.
- prependAvatarstring
- prependIcon
- Icon prepended before the field.
- prependAriaLabelstring
- appendAriaLabelstring
- transitionboolean | 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:menuboolean
- Fired when the calendar dropdown opens or closes.
- @update:modelValueany
- Fired when the selected date(s) change.
- @focusFocusEvent
- Fired when the field receives focus.
- @blurFocusEvent
- Fired when the field loses focus.
- @click:clearMouseEvent
- 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
Keyboard interactions
| Key | Action |
|---|---|
| Enter / Space (on field) | Opens the calendar dropdown. |
| Escape | Closes the calendar dropdown and returns focus to the field. |
| Tab | Moves 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
Date range field
Multiple dates