Analytics
Mobile date range button
The compact date-range trigger used below md.
Available
Ports as-is
Dual breakpoint
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Mobile date range button
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
dateRange* | string | — | Stored preset key (`"30d"`, `"ytd"`, …) or `"custom"`. |
onDateRangeChange* | (range: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
customStartDate | Date | — | Undocumented — add TSDoc to the prop in the library. |
customEndDate | Date | — | Undocumented — add TSDoc to the prop in the library. |
onCustomDateRangeChange | (start: Date, end: Date) => void | — | Undocumented — add TSDoc to the prop in the library. |
open | boolean | — | Controlled panel state. Leave undefined for the button's own toggle, and use `defaultOpen` to pin a story to the open state. |
defaultOpen | boolean | false | Initial panel state when uncontrolled. |
onOpenChange | (open: boolean) => void | — | Undocumented — add TSDoc to the prop in the library. |
now | Date | DATE_RANGE_DEFAULT_NOW | Reference "today" — resolves the relative presets. |
epoch | Date | DATE_RANGE_DEFAULT_EPOCH | Start of the "All time" range. |
presets | DateRangePresetOption[] | — | Override the panel's preset sidebar. |
usePortal | boolean | — | Render the panel into `document.body`. Off keeps it inside a docs block. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/analytics/MobileDateRangeButton.tsx- Portability
- Copies across unchanged — only the utils import path moves.
- Responsive
- Carries a load-bearing
max-md:/md:pair. Sign off at both viewports — see the rule.