Beta

Date Range Timeline

A smooth horizontal timeline scrubber for selecting date ranges. Think Linear/Vercel analytics date range selector.

Made by lucasInspired by AliGrids
Apr 1Today
1

Installation

Usage

import { DateRangeTimeline } from "@/components/targetblank/components/date-range-timeline";
import { subDays } from "date-fns";
import React from "react";

export default function Example() {
  const [range, setRange] = React.useState({
    from: subDays(new Date(), 30),
    to: new Date(),
  });

  return (
    <DateRangeTimeline
      value={range}
      onChange={setRange}
      className="w-full max-w-2xl"
    />
  );
}

Props

PropTypeDefault
className?
string
-
historyDays?
number
120
onChange?
(range: { from: Date; to: Date }) => void
-
value?
{ from: Date; to: Date }
-