← 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).
| Argument | Type | Default | Description |
|---|---|---|---|
| input_id | character | required | Shiny input binding identifier. |
| start | Date | character | NULL | Range start (Date, POSIX time, or yyyy-mm-dd string). Provide both start and end, or neither (NULL starts empty). |
| end | Date | character | NULL | Range end. A reversed start/end pair is silently ordered, matching dateRangeInput(). |
| min | Date | character | NULL | Earliest selectable date. NULL for no lower bound. |
| max | Date | character | NULL | Latest selectable date. NULL for no upper bound. |
| separator | character | ' \u2013 ' | Text placed between the two endpoints on the trigger label. |
| placeholder | character | 'Pick a date range' | Trigger text shown before a range is selected. |
| format | character | '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. |
| weekstart | integer | 0 | First day of the week (Shiny convention: 0 = Sunday, 6 = Saturday). |
| disabled | logical | FALSE | Disable user interaction. |
| invalid | logical | FALSE | Apply aria-invalid and destructive border/ring styling. |
| width | character | NULL | CSS width applied to the wrapper. |
| class | character | NULL | Additional styling classes. |
| style | character | NULL | Inline 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.
| Argument | Type | Default | Description |
|---|---|---|---|
| session | ShinySession | required | Active Shiny session object. |
| input_id | character | required | Target input ID. |
| start | Date | character | missing | Replacement range start. Omit to leave unchanged. |
| end | Date | character | missing | Replacement range end. Omit to leave unchanged. |
| min | Date | character | missing | Replacement lower bound. Pass NULL to clear the bound. |
| max | Date | character | missing | Replacement upper bound. Pass NULL to clear the bound. |
| separator | character | missing | Replacement separator text. |
| placeholder | character | missing | Replacement placeholder text. |
| disabled | logical | missing | Toggle input disabled state. |
| invalid | logical | missing | Update invalid border styling. |
| notify | logical | TRUE | Whether a range change fires a Shiny input event. Cosmetic-only updates never notify. |
| clear | logical | FALSE | Clear the selected range (sends an explicit empty range). Takes precedence over start/end. |