Skip to content
GitHub (opens in a new tab)

DateRangePicker

Pick a date range from named presets such as This month or Last 30 days, from two months side by side, or by typing the start and end, then Apply.

stableMoleculecontracts/daterangepicker.json

Preview

DateRangePicker

A period with presets such as This month or Last 30 days, two months side by side, and typed start and end dates. Below 40rem it opens as a bottom sheet.

Master

A preset, two day clicks, or a typed start and end set a pending range. Apply commits it; Cancel, Close or Escape leave the value as it was.

Usage

Wrap with Field. One date is DatePicker. Every date range is DateRangePicker: pass presets={[]} for the months and the typed fields only.

Do's

  • A report or filter period with presets like This month or Last 30 days
  • A start and end date in one field
  • A range with no presets — pass presets={[]}

Don'ts

<Field label="Period" htmlFor="period"><DateRangePicker id="period" /></Field>

When to use

  • A report or filter period with presets like This month or Last 30 days
  • A start and end date in one field
  • A range with no presets — pass presets={[]}

When not to use

  • One date — use DatePicker
  • A schedule of events — use Calendar

What an agent reads

import { DateRangePicker } from "agentic-ds-kit";
must
  • Escape closes only this panel, not a parent Modal, Drawer or AlertDialog
  • Trigger is a button with aria-haspopup=dialog, aria-expanded, and aria-controls
  • Overlay is role=dialog aria-modal labelled Choose dates and contains the month grid
  • Presets sit on the start and two months side by side. A preset, a first and second day click, or a valid typed start and end sets a pending range; Apply commits it and closes. Cancel, Close, Escape, or a click outside leave the value as it was
  • Header is the shared overlay header: CalendarDays icon, the pending range status as the eyebrow (Pick a start date, Pick an end date, or the range), the Choose dates title, and Close
  • Footer: typed start and end fields (YYYY-MM-DD, named by the startDate and endDate labels, with the rangeTo word between them), then Cancel and Apply. A typed day outside minDate/maxDate or turned off by isDateDisabled shows the field error and does not change the range
  • Below 40rem the panel opens as the kit Drawer bottom sheet: presets, one month and the typed fields in the body, Cancel and Apply in the sheet footer
  • Escape closes and returns focus to the trigger. Tab stays inside the dialog
  • Must have a Field label pointing at id
  • built-in labels (previousMonth, nextMonth, chooseDates, presets, startDate, endDate, rangeTo, close) come from KitLabelsProvider; English by default
defaults
  • size md
  • placeholder Pick dates
  • disabled false
  • error false
  • weekStart 0
stops if
  • Do not wrap DateRangePicker in Popover. Do not invent a second calendar or a native input type=date
  • Do not use two DatePickers for start and end
  • Do not add time — ask first
  • Do not use raw hex

From contracts/daterangepicker.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
idstringYes——
sizemd | sm | lgNomdTrigger height sm 32, md 36, lg 40, like Input.
value{ start: string, end?: string }No—Controlled. YYYY-MM-DD.
defaultValue{ start: string, end?: string }No——
onValueChangefunctionNo—(range: { start, end? }) => void
presetsarrayNo—Replaces Today, Yesterday, Last 7 days, Last 30 days, This month, and Last month. Each item is { id, label, start, end }.
placeholderstringNoPick dates—
disabledbooleanNofalse—
errorbooleanNofalse—
minDatestringNo——
maxDatestringNo——
weekStartenumNo0First day of the week: 0 Sunday, 1 Monday.
isDateDisabledfunctionNo—(date: string) => boolean. Turns single days off. Those days, and days outside minDate/maxDate, are struck through, named unavailable, and refused by the typed fields.
namestringNo—Hidden input submits start/end, like 2026-10-01/2026-10-31
describedBystringNo——
  • Component
    →

    DatePicker

    Form field that opens a month grid to pick one date.

  • Component
    →

    Calendar

    A full calendar of events by month, week, day, or list.

  • Screen
    →

    Audit log

    Every action by people and agents in the workspace, filterable, with before and after for each change.

  • Pattern
    →

    Dashboard

    Billing home: four KPIs that drive the revenue chart, Needs attention, overdue invoices, a Revenue tab of analysis charts, and an Ask panel.