Basic Usage
Use the component as a simple date range input that stores a start and end string.
A date range picker with presets and a custom range flow.
npx shadcn-vue@latest add https://dsn-ui.pages.dev/r/dsn-date-range-picker.jsonUse the component as a simple date range input that stores a start and end string.
Show built-in quick ranges first, then let the user switch into the custom calendar flow.
Try the quick ranges first, then use Select date range for a manual range.
Guide the calendar to a specific month and keep selection inside an allowed booking window.
Use a custom empty-state prompt while keeping localized range formatting for the chosen locale.
Override the internal preset and action labels without changing the selected locale.
Use short date formatting when you want a denser trigger display.
Listen to the clear event to trigger side effects when the user resets the date range.
| Prop | Type | Description |
|---|---|---|
| v-model | { start?: string; end?: string } | undefined Default: undefined | Selected range model. Values are emitted as date strings in YYYY-MM-DD format. Example: { start: "2026-04-12", end: "2026-04-18" } |
| minValue | string | Date | DateValue Default: undefined | Minimum selectable date in the custom range calendar. Example: 2026-05-10 |
| maxValue | string | Date | DateValue Default: undefined | Maximum selectable date in the custom range calendar. Example: 2026-05-24 |
| defaultDateView | string | Date | DateValue Default: undefined | Controls which month is shown first when the picker opens with no current selection. Example: 2026-05-01 |
| placeholder | string Default: undefined | Custom placeholder for the trigger input when no range is selected. Example: Select reporting period |
| clearable | boolean Default: false | Shows a clear button in the trigger when a range is selected and the popover is closed. Example: true |
| presets | readonly DateRangePreset[] Default: [] | Preset options shown before the custom calendar. Built-in keys: last-7-days, last-30-days, this-month, last-month. Custom entries accept `{ id?, label, value }` where `value` is a fixed range or callback. Example: ["last-7-days", { label: "Next 14 days", value: () => ({ start: new Date(), end: new Date() }) }] |
| locale | string Default: en-US | Locale used for date formatting and language fallback. Example: id-ID |
| dateStyle | Intl.DateTimeFormatOptions['dateStyle'] Default: medium | Controls the formatted trigger text. Possible values: full, long, medium, short. Example: short |
| lang | Partial<LangItems> Default: undefined | Overrides internal labels. Available keys: pick_date_range, clear_date, last_7_days, last_30_days, this_month, last_month, custom_date_range. Example: { custom_date_range: "Pilih manual" } |
| Event | Payload | Description |
|---|---|---|
| @clear | void | Triggered when the user clicks the clear button to reset the value. |