Early bird: 30% off Dashral ProSee pricing

Dashral

Range PickerPro

A date button that widens into its range panel: presets beside one or two months, a range that glides to its new days, and Apply.

Installation

When to use

  • The dates of a report or a dashboard: a preset in one click (Last 7 days, This quarter), any range in two.
  • Where the range matters at a glance: the band shows its length across the weeks while you pick.

When not to use

  • One date: a Date Picker picks it with less.
  • A date in a form among other fields: the kit's Date Range Picker sits in a form more quietly.

Usage

Range Picker with your own data: a whole component you can paste as a page.

example.tsx
"use client"

import { RangePicker } from "@/components/dashral/pro/range-picker"

import { useState } from "react"

export default function ReportDates() {
  const [range, setRange] = useState<{ from: Date; to: Date } | null>(null)
  return <RangePicker value={range} onValueChange={setRange} />
}

API reference

RangePicker

A date button that widens into a range panel: presets, one or two months with a range that glides to its new days, and Apply. Arrows move by day and week, Page Up and Page Down by month, Enter picks, Escape cancels.

PropTypeDefault
valueDateRange | null—
defaultValueDateRange | nullnull
onValueChange(range: DateRange | null) => void—
presetsRangePreset[]

Ranges one click away; the usual ones by default (Today, Last 7 days…). An empty list hides them.

sample
placeholderstring

The button's words while nothing is picked; "Pick dates" by default.

"Pick dates"
minDate

No day before / after these.

—
maxDate—
weekStartsOnnumber

0 Sunday (default) to 6 Saturday.

0
localestring

For the dates' names and format; the page's language by default.

—
side"bottom" | "top""bottom"
align"start" | "end""start"
classNamestring—
classNamesRangePickerClassNames—

type DateRange

PropTypeDefault
fromDate—
toDate—

type RangePreset

PropTypeDefault
labelstring—
range(today: Date) => DateRange

The range it picks, from today.

—

type RangePickerClassNames

PropTypeDefault
rootstring—
buttonstring—
panelstring—

Keyboard

KeysAction
TabReach the button, then the presets, the days and Apply
EnterorSpaceOpen it; on a day, pick it (first day, then last)
←or→The day before or after
↑or↓The same day a week before or after; in the presets, the one above or below
HomeorEndThe start or end of the week
Page UporPage DownThe month before or after (with Shift, the year)
EscCancel and close; the focus returns to the button

Accessibility

  • The button says it opens a dialog and whether it's open; the panel is a dialog named Pick dates.
  • Each month is a grid named by its month; each day is a button named in full ("Monday, November 3, 2026") with one tab stop, today marked aria-current and days in the range aria-selected.
  • The months' names and the range's length are live regions; nothing outside changes until Apply.

Motion

  • As Command Button opens: the button widens into the panel (0.42 s) and shrinks back onto it, the two crossfading as its words change to the new dates.
  • The range is a band in each week that glides to its new first and last day (0.32 s) as a preset or a pick changes it; months slide the way you go.
  • Smooth tweens on [0.4, 0, 0.2, 1], never springs, except the small press on Apply. With reduced motion it only fades.