← Back to Components
Date Picker
Calendar popover for single-date selection with a shiny.date value binding.
Interactive Playground
R Code
API Reference
block_date_picker()
A shadcn-style date picker: a trigger button plus a portaled calendar popover, backed by a shiny.date value binding (input$id is a length-1 Date).
| Argument | Type | Default | Description |
|---|---|---|---|
| input_id | character | required | Shiny input binding identifier. |
| value | Date | character | NULL | Initial date (Date, POSIX time, or yyyy-mm-dd string). NULL starts empty (placeholder first). |
| min | Date | character | NULL | Earliest selectable date. NULL for no lower bound. |
| max | Date | character | NULL | Latest selectable date. NULL for no upper bound. |
| placeholder | character | 'Pick a date' | Trigger text shown before a date is selected. |
| format | character | 'yyyy-mm-dd' | Display format for 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_picker()
Updates the value, bounds, and cosmetic props of a date picker from R. Omitted arguments are left unchanged; pass clear = TRUE to empty the value.
| Argument | Type | Default | Description |
|---|---|---|---|
| session | ShinySession | required | Active Shiny session object. |
| input_id | character | required | Target input ID. |
| value | Date | character | missing | Replacement date. 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. |
| 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 value change fires a Shiny input event. Cosmetic-only updates never notify. |
| clear | logical | FALSE | Clear the selected date (sends an explicit empty value). Takes precedence over value. |