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 DatePickerComposition
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.
The model type is inferred from calendarProps.mode: string | undefined for single mode and RangeValue for range and week modes. Use ref<string>() or ref<RangeValue>() accordingly.
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
Custom trigger
Use the trigger slot to replace the default Input with a custom Popover trigger. Use a button for keyboard support and v-model to display the selected value. Input props and native input attributes apply only to the default Input.
Selected: —
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: {}