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/ui/components/DateRangePicker";

Examples

Overview

Limits

Shortcuts

Month stepper

size

API

In the calendars, the arrow keys move focus by a day or a week, Home and End move it to the Sunday or Saturday of the week, 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 maxRangeDays while a range is being picked. Enter and Space pick the focused day.

PropTypeDefaultDescription
valueDateRange | null—Required. Selected range ([start, end], inclusive)
onChange(next: DateRange | null, shortcut?: DateRangeShortcut) => void—Required. Called when the range changes
minDateTime—Earliest selectable date (inclusive)
maxDateTime—Latest selectable date (inclusive). Must not be before min
maxRangeDaysnumber—Max length of range in days (inclusive)
shortcutsDateRangeShortcut[]—Quick selection shortcuts ({ label, getDateRange })
side"top" | "right" | "bottom" | "left""bottom"Preferred side for popover
sideOffsetnumber8Distance from trigger in pixels
align"start" | "center" | "end""center"Preferred popover alignment
alignOffsetnumber0 (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
dropdownIconType"chevronDown" | "dropdown" | "none""dropdown"Icon shown at trigger end
triggerClassNamestring—Custom class for trigger
triggerShowIconbooleantrueShow calendar icon at trigger start
triggerStepperUnit"month"—Enable month stepper mode in trigger
triggerDateFormatstring"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))