PeriodControl

Outside the canon

The reporting period: a SegmentedControl of 7, 30 and 90 days plus Custom, which opens a Popover (anchored to the whole control, so only Custom opens it) with the Calendar in range mode — two months from lg, one below, nothing after today — and a footer band with the picked range, Cancel and Apply. Lifted out of the Overview's Period overview on 2026-10-13 so the index pages' summaries share it. Controlled: the caller decides where the value lives (the Overview writes a custom range to the URL; the Transactions summary holds it in state). The window a value means is lib/period's periodWindow, the same edges for a preset and a hand-picked range.

App: Ui::PeriodControlComponent (suggested): the segments as links (?period=30); Custom as the popover controller around a flatpickr range input

Presets and Custom

#default

30 days by default. Custom opens the range calendar (today is Feb 10, 2026, the mock clock); Apply sets the range and the label beside it follows.

Last 30 days

Props

NameTypeDefaultNotes
value{ preset: 7 | 30 | 90 } | { from: string; to: string }—A custom range is calendar dates, yyyy-mm-dd, both ends included
onChange(value: PeriodValue) => void—A preset on click; a custom range on Apply
todaystring—yyyy-mm-dd: the calendar's today and its last selectable day (the account's, not the browser's)
labelstring"Period"The radiogroup's accessible name
placementbottom-end | bottom-start"bottom-end"Where the Custom panel opens