← Back to Components

Date Range Picker

Calendar popover for two-endpoint range selection with a length-2 shiny.date value binding.

Interactive Playground

R Code

API Reference

block_date_range_picker()

A shadcn-style date range picker: a trigger button plus a portaled two-endpoint calendar popover, backed by a shiny.date value binding (input$id is a length-2 Date, c(start, end), or NULL while incomplete).

ArgumentTypeDefaultDescription
input_idcharacterrequiredShiny input binding identifier.
startDate | characterNULLRange start (Date, POSIX time, or yyyy-mm-dd string). Provide both start and end, or neither (NULL starts empty).
endDate | characterNULLRange end. A reversed start/end pair is silently ordered, matching dateRangeInput().
minDate | characterNULLEarliest selectable date. NULL for no lower bound.
maxDate | characterNULLLatest selectable date. NULL for no upper bound.
separatorcharacter' \u2013 'Text placed between the two endpoints on the trigger label.
placeholdercharacter'Pick a date range'Trigger text shown before a range is selected.
formatcharacter'yyyy-mm-dd'Display format for each endpoint on the trigger label (yyyy/yy, mm/m, MM/M, dd/d, DD/D tokens). The transported value is always ISO.
weekstartinteger0First day of the week (Shiny convention: 0 = Sunday, 6 = Saturday).
disabledlogicalFALSEDisable user interaction.
invalidlogicalFALSEApply aria-invalid and destructive border/ring styling.
widthcharacterNULLCSS width applied to the wrapper.
classcharacterNULLAdditional styling classes.
stylecharacterNULLInline styling string applied to the trigger.

update_block_date_range_picker()

Updates the range, bounds, and cosmetic props of a date range picker from R. Omitted arguments are left unchanged; start and end can be updated independently. Pass clear = TRUE to empty the range.

ArgumentTypeDefaultDescription
sessionShinySessionrequiredActive Shiny session object.
input_idcharacterrequiredTarget input ID.
startDate | charactermissingReplacement range start. Omit to leave unchanged.
endDate | charactermissingReplacement range end. Omit to leave unchanged.
minDate | charactermissingReplacement lower bound. Pass NULL to clear the bound.
maxDate | charactermissingReplacement upper bound. Pass NULL to clear the bound.
separatorcharactermissingReplacement separator text.
placeholdercharactermissingReplacement placeholder text.
disabledlogicalmissingToggle input disabled state.
invalidlogicalmissingUpdate invalid border styling.
notifylogicalTRUEWhether a range change fires a Shiny input event. Cosmetic-only updates never notify.
clearlogicalFALSEClear the selected range (sends an explicit empty range). Takes precedence over start/end.