Skip to content

DateRange

The DateRange widget displays two native browser date inputs: start and end. Its value is available as a list of ISO date strings: ["YYYY-MM-DD", "YYYY-MM-DD"].

import mercury as mr
date_range = mr.DateRange(
label="Select date range",
value=("2026-04-01", "2026-04-30")
)
date_range.value

type: string

Text displayed above the inputs. The default is "Date range".

type: tuple[str, str] | list[str] | None

Initial start and end dates in YYYY-MM-DD format.

type: string

Minimum allowed date for both inputs.

type: string

Maximum allowed date for both inputs.

type: string

URL query parameter name used to override the start date.

type: string

URL query parameter name used to override the end date.

type: "sidebar" | "inline" | "bottom"

Controls where the widget is rendered. The default is "sidebar".

type: bool

If True, both inputs are visible but cannot be edited.

type: bool

If True, the widget exists in app state but is not rendered.

type: string

Unique identifier used to distinguish widgets with identical arguments.