Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Date Range Picker

Preview

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/date-range-picker

Import the shared styles once in your application.

TSUsage
import DateRangePicker from '@/components/beui/controls/DateRangePicker.vue'
import '@/components/beui/styles.css'

API Reference

DateRangePicker

v-model?
DateRange | null

The range, `{ from, to? }` as YYYY-MM-DD, or `null`. Use with `v-model`.

Defaultundefined
defaultValue?
DateRange | null

Uncontrolled initial range.

Defaultundefined
defaultMonth?
string

Month shown first, any date in it (YYYY-MM-DD).

Default—
min?
string
Default—
max?
string
Default—
isDateDisabled?
(date: string) => boolean
Default—
presets?
readonly DateRangePreset[]
Default—
locale?
string
Default—
label?
string
Default—
disabled?
boolean
Defaultfalse
autoFocus?
boolean

Move focus to the active date on mount (an inline calendar) or on open (the popover).

Defaultundefined
showSummary?
boolean

Show the start/end summary above the calendar. Defaults to true inline, false in the popover.

Defaultundefined
class?
string
Default—
#default?
slot

Compose the picker from its parts. Omit it for the ready-made trigger and calendar.

Default—
v-model:open?
boolean

Controlled open state, `v-model:open`.

Defaultundefined
defaultOpen?
boolean

Starts open when `v-model:open` is not bound.

Defaultfalse
closeOnSelect?
boolean

Close an open popover after a complete range or preset. Default false.

Defaultfalse
labels?
Partial<DateRangePickerMessages>

Override any built-in string.

Default—
inline?
boolean

Render the calendar inline instead of behind a trigger.

Defaultfalse
placeholder?
string

Trigger text when no range is chosen.

Default—

DateRangePickerCalendar

showSummary?
boolean

Show the start/end summary above the calendar. Defaults to the picker's `showSummary`.

Defaultundefined
class?
string
Default—
bare?
boolean

Drop the card chrome when the calendar sits inside a popover.

Default—
#default?
slot

The calendar's parts, in the order you want them.

Default—

DateRangePickerSummary

class?
string
Default—

DateRangePickerHeader

class?
string
Default—

DateRangePickerGrid

class?
string
Default—

DateRangePickerSelection

class?
string
Default—
#default?
slot

Replaces the text.

Default—

DateRangePickerClear

class?
string
Default—
disabled?
boolean
Default—
#default?
slot

Replaces the label.

Default—

DateRangePickerFooter

class?
string
Default—
#default?
slot

Replaces the default footer content.

Default—

DateRangePickerPresets

class?
string
Default—
#default?
slot

Your own `DateRangePickerPreset`s.

Default—

DateRangePickerPreset

value
DateRange
Default—
label
string

Accessible preset name and selection announcement.

Default—
class?
string
Default—
disabled?
boolean
Default—
#default?
slot

Replaces the visible label.

Default—

DateRangePickerTrigger

placeholder?
string

Text when no range is chosen.

Default—
class?
string
Default—
disabled?
boolean
Default—
#default?
slot

Replaces the icons and the range summary.

Default—

DateRangePickerContent

autoFocus?
boolean

Move focus to the active calendar date when opened.

Defaulttrue
side?
"bottom" | "top"
Defaultbottom
align?
"start" | "end"
Defaultstart
sideOffset?
number

Gap between trigger and panel, in px.

Default—
radius?
number

Panel corner radius, in px.

Default16
shadow?
boolean

Draw the surface shadow.

Defaultfalse
@open-auto-focus?
(content: HTMLElement) => void

Runs after the surface is positioned and visible, with its element.

Default—
initialFocus?
HTMLElement | null | (() => HTMLElement | null)

Element to focus when a keyboard open shows the panel, instead of the active date.

Default—
class?
string
Default—
#default?
slot
Default—

DateRangePickerDropdown

placeholder?
string

Trigger text when no range is chosen.

Default—
triggerClassName?
string

Extra classes for the trigger.

Default—
calendarClassName?
string

Extra classes for the calendar.

Default—
defaultValue?
DateRange | null

Uncontrolled initial range.

Defaultundefined
autoFocus?
boolean

Move focus to the active date on mount (an inline calendar) or on open (the popover).

Defaulttrue
class?
string
Default—
min?
string
Default—
max?
string
Default—
label?
string
Default—
v-model?
DateRange | null

The range, `{ from, to? }` as YYYY-MM-DD, or `null`. Use with `v-model`.

Defaultundefined
disabled?
boolean
Defaultfalse
labels?
Partial<DateRangePickerMessages>

Override any built-in string.

Default—
locale?
string
Default—
v-model:open?
boolean

Controlled open state, `v-model:open`.

Defaultundefined
closeOnSelect?
boolean

Close an open popover after a complete range or preset. Default false.

Defaultfalse
defaultMonth?
string

Month shown first, any date in it (YYYY-MM-DD).

Default—
isDateDisabled?
(date: string) => boolean
Default—
presets?
readonly DateRangePreset[]
Default—
showSummary?
boolean

Show the start/end summary above the calendar. Defaults to true inline, false in the popover.

Defaultfalse
defaultOpen?
boolean

Starts open when `v-model:open` is not bound.

Defaultfalse
inline?
boolean

Render the calendar inline instead of behind a trigger.

Defaultfalse

Updated