Skip to Content
@get-asset/reactComponents

Date Picker

One styled trigger for both jobs: a calendar period or a custom range. The popover puts a segmented Period / Custom switch above the active panel — the period grid or the range calendar. Both edit the provider's single date range, so switching modes changes the view and never the selection. That range is what every date-driven component reports on, so a choice here moves the whole page. Pinned to day, the same trigger picks one day: the end of the provider range, which a pick collapses onto that day.

Preview

Loading preview…

API reference

Root props

PropTypeDefaultDescription
minCalendarDateString—Earliest selectable date, inclusive. Applies to every mode.
maxCalendarDateString—Latest selectable date, inclusive. Applies to every mode.
mode"period" | "range" | "day"—Locks the picker to a single panel and hides the Period / Custom switch. Omitted, the period and range panels are offered. Mount "period" on a surface built around period-over-period comparisons, so the range always names a month, quarter or year. "day" is a single-day calendar bound to the provider as a one-day range, unless value and onValueChange are given.
valueCalendarDateString—Day mode only, with onValueChange: the selected day as YYYY-MM-DD, or "" for none. Makes the picker a controlled field that never touches the provider range.
onValueChange(value: CalendarDateString) => void—Day mode only, with value: receives the picked day as YYYY-MM-DD.
disabledboolean—Disables the trigger and every panel.
classNamestring—Class on the trigger button.

Modes

Every date-driven component under the provider follows the committed range, unless it was detached with its own dateFrom/dateTo props. Cards that compare against a previous period only do so period-over-period when the range names one, so mount mode="period" on a surface built around those comparisons; a custom range is compared against the same number of days immediately before it.

Opening lands on the mode that matches what is selected: an exact calendar year, quarter, or month opens on Period, anything else on Custom. In Custom the first click picks the start, the second writes both provider dates together, and the third starts a new range; closing mid-pick discards it. In Period a choice applies as it is made and the panel stays open. A fixed mode always opens on its own panel.

mode="day" is for a surface reported as of one day, such as a trial balance or an aged report. The trigger shows the end of the provider range (Mar 15, 2026), the day the page reports on, so seed the provider with a dateTo on or before max. The calendar opens on its month with that day selected, and a pick sets the provider range to that one day and closes the popover. Given value and onValueChange it is instead a controlled field for a form, which neither reads nor writes the provider range.

On this page