← 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).

ArgumentTypeDefaultDescription
input_idcharacterrequiredShiny input binding identifier.
valueDate | characterNULLInitial date (Date, POSIX time, or yyyy-mm-dd string). NULL starts empty (placeholder first).
minDate | characterNULLEarliest selectable date. NULL for no lower bound.
maxDate | characterNULLLatest selectable date. NULL for no upper bound.
placeholdercharacter'Pick a date'Trigger text shown before a date is selected.
formatcharacter'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.
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_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.

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