Atoms / Date range picker

Date range picker

A period: quick picks, then a month where the first click sets the start and the second the end.

import { DateRangePicker, type DateRange } from "@forgeron/ui";
/01 → Period
import { DateRangePicker, type DateRange } from "@forgeron/ui";
import { useState } from "react";

export default function Period() {
  const [range, setRange] = useState<DateRange>({ from: "2026-11-03", to: "2026-11-18" });
  return <DateRangePicker label="Period" today="2026-11-19" value={range} onChange={setRange} />;
}
/02 → Chip
import { DateRangePicker } from "@forgeron/ui";

export default function Chip() {
  return (
    <DateRangePicker
      label="Sprint"
      variant="chip"
      today="2026-11-19"
      placeholder="Set sprint"
      presets={[]}
    />
  );
}
API → Props
PropTypeDefaultDescription
labelstring—e.g. Period.
value / defaultValue{ from, to }—Controlled or not. Each YYYY-MM-DD or null.
onChange(range: DateRange) => void—Complete ranges only.
presets{ label, from, to }[]rangePresets(today)Today, last 7 and 30 days, this and last month; [] for none.
min / maxstring—Days outside cannot be chosen.
todaystringthe device's dateOutlined.
clearablebooleantrueOffers to remove the range.
variant"field" | "chip""field"A form control, or a record's property.
disabledboolean—Not editable.
classNamestring—Extra classes.