DatePicker

A date picker built as a wrapper around Popover, Dropdown, Calendar, Button, and Input.

Install

Run the following command to install the date picker component:

npx acc-nuxt add DatePicker

Composition

DatePicker is a playground wrapper that composes existing Accelerator components: Button, Input, Popover, Dropdown, and Calendar.

See each component's own documentation page for the props, slots, and CSS variables it exposes.

Native input attributes such as name and aria-* are forwarded to the composed Input component; placeholder is exposed as a DatePicker prop. Use inputProps, calendarProps, and popoverProps to configure the composed components directly.

Single mode

Days

Selected: —

Months

Selected: —

Years

Selected: —

Range mode

Days

Range: —

Months

Range: —

Years

Range: —

Week mode

Set calendarProps.mode to week to show the day grid and preview a whole week on hover. Clicking a day immediately sets v-model to a seven-day { start, end } range in YYYY-MM-DD format.

Weeks start on Monday by default. Configure weekStartsOn and date restrictions through calendarProps; see Calendar week selection.

Initial ranges with both dates are kept as supplied until a week is selected.

Week: 2026-09-28 to 2026-10-04

Behavior

Close on selection

closeOnSelect defaults to false in single and week modes. Set close-on-select to close the popover after selection.

Selected: —

Form

Single

Form values: { "birthdate": "", "tripleDate": { "start": "2025-10-01", "end": "2025-10-31" } } | Form errors: {}

Range

Form values: { "birthdate": "", "tripleDate": { "start": "2025-10-01", "end": "2025-10-31" } } | Form errors: {}

Props

popoverProps:AccPopoverProps— optional
default:{ alignWithCursorX: true }
Props forwarded to the Popover component. See Popover docs.
inputProps:Omit<AccInputProps, 'allowedSizes' | 'size'> & { size?: Parameters<typeof AcceleratorInput>[0]['size'] }— optional
default:{ validateOnBlur: false, validateOnInput: true }
Input props forwarded to the composed Input, excluding its wrapper-only allowedSizes prop. The size type follows AcceleratorInput.
calendarProps:AccCalendarProps— optional
default:{ locale: "en" }
Props forwarded to the Calendar component. See Calendar docs.
placeholder:string— optional
default:Select a date
Placeholder forwarded to the composed Input when no value is selected.
name:string— optional
Name forwarded to the composed Input for native forms and validation.
closeOnSelect:boolean— optional
default:false
Close the popover after selecting a single value or week.

Bindings

v-model:string | RangeValue
Selected value for the configured mode. Week mode returns { start, end } dates in YYYY-MM-DD format.
v-model:current-month:number
Controls the currently displayed month.
v-model:current-year:number
Controls the currently displayed year.

Emits

@update:modelValue
Emitted when the selected date, month, year, or range changes.
@update:currentMonth
Emitted when the displayed month changes.
@update:currentYear
Emitted when the displayed year changes.