Date Range Picker

Date range picker with an interactive calendar, min/max limits, preset shortcuts, and a month stepper for selecting start and end dates.

import { DateRangePicker } from "@plexui/vue/components/DateRangePicker";

On Phone, put a date range picker in a row of a FieldGroup, as the Settings Forms do. In the row the range and its up-down chevrons end at the row's edge, as a pop-up, and open the calendar. The row is its frame and sets its height, insets and type, so the phone examples leave out size, pill and clearable, set :trigger-show-icon="false", show short dates (trigger-date-format="MMM d") and None when there is no range. In a row the month of a month stepper keeps the width of the longest month, so its arrows stay put when the month changes.

Examples

Overview

Limits

Shortcuts

Month stepper

API

In the calendars, the arrow keys move focus by a day or a week, Home and End move it to the first or last day of the week row, and Page Up and Page Down move it by a month (January 31 goes to the last day of February). Focus moves across the visible months, and a day past them turns the calendars by a month first. Focus stays put when the day it would move to is disabled: outside min and max, or past max-range-days while a range is being picked. Enter and Space pick the focused day.

PropTypeDefaultDescription
value / v-model:valueDateRange | null—Selected range ([start, end], inclusive)
@change(next: DateRange | null, shortcut?: DateRangeShortcut) => void—Emitted when the range changes
minDateTime—Earliest selectable date (inclusive)
maxDateTime—Latest selectable date (inclusive). Must not be before min
max-range-daysnumber—Max length of range in days (inclusive)
week-starts-on0 | 1 | 2 | 3 | 4 | 5 | 60The day each week starts on, from 0 (Sunday) to 6 (Saturday)
shortcutsDateRangeShortcut[]—Quick selection shortcuts ({ label, getDateRange }), shown next to the calendar from the md breakpoint up
side"top" | "right" | "bottom" | "left""bottom"Preferred side of the calendar popover. On phones, left and right prefer bottom so all seven day targets fit. Top and bottom keep their preference; collisions can still flip placement.
side-offsetnumber8Distance from trigger in pixels
align"start" | "center" | "end""center"Preferred popover alignment
align-offsetnumber0 (center), -5 (start, end)Offset from start/end alignment in pixels
disabledbooleanfalseDisable picker interactions
placeholderstring"Select date range..."Placeholder in trigger when value is empty
variant"soft" | "outline" | "ghost""outline"Trigger style variant
pillbooleantrueRounded trigger shape
size"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl""md"Trigger size scale
dropdown-icon-type"chevronDown" | "dropdown" | "none""dropdown"Icon shown at trigger end
trigger-class-namestring—Custom class for trigger
trigger-show-iconbooleantrueShow calendar icon at trigger start
trigger-stepper-unit"month"—Enable month stepper mode in trigger
trigger-date-formatstring"MM/dd/yy"Date formatting in trigger text
clearablebooleanfalseShow clear button in trigger
blockbooleanfalseStretch trigger to full available width

Styling

Date Range Picker reads these component tokens. Override them at any scope to restyle it:

  • --input-border-color-invalid: border color invalid (default var(--color-border-danger-outline))
  • --input-outline-border-color: outline border color (default var(--color-border-primary-outline))
  • --input-outline-border-color-hover: outline border color hover (default light-dark(var(--alpha-25), var(--alpha-30)))
  • --input-placeholder-text-color: placeholder text color (default var(--color-text-tertiary))
  • --input-text-color: text color (default var(--color-text))
  • --select-control-font-weight: font weight (default var(--font-weight-normal))