Hero Ui

DateRangePicker

Buttons 1

About

Composable date range picker built on React Aria DateRangePicker with DateField and RangeCalendar composition.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds DateRangePicker to your project and fits it to your theme.

Code

How DateRangePicker is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import { Button, DateRangePicker, parseDate } from "@/components/ui/heroui-date-range-picker";

const week = { start: parseDate("2026-06-02"), end: parseDate("2026-06-06") };
const sourcePreviewCurrentValue = "Current value: 2026-06-02 -> 2026-06-06";

export default function ControlledDemo() {
  const [value, setValue] = React.useState(week);
  return (
    <div className="flex min-h-screen w-full items-center justify-center overflow-hidden bg-background p-8">
      <div className="controlled-demo">
        <style>{`
          .controlled-demo{display:flex;width:20rem;flex-direction:column;gap:12px;color:inherit}
          .controlled-status{font-size:14px;line-height:20px;color:hsl(var(--muted-foreground,240 5% 64%))}
          .controlled-actions{display:flex;gap:8px}
        `}</style>
        <DateRangePicker label="Trip dates" value={value} onChange={setValue} />
        <span className="controlled-status">{value ? sourcePreviewCurrentValue : "Current value: (empty)"}</span>
        <div className="controlled-actions">
          <Button onClick={() => setValue(week)}>Set week</Button>
          <Button variant="secondary" onClick={() => setValue(null)}>Clear</Button>
        </div>
      </div>
    </div>
  );
}

export { ControlledDemo };

More by Hero Ui

View all
  • DatePicker

    DatePicker

    471
  • Chip

    Chip

    448
  •  The Pagination

    The Pagination

    366
  • HeroUI Table

    HeroUI Table

    122
  • HeroUI Color Picker

    HeroUI Color Picker

    114
  • Skeleton

    Skeleton

    106
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    97
  • HeroUI AlertDialog

    HeroUI AlertDialog

    83

More in Buttons

View all
  • Texture Button

    Texture Button

    108
  • Button

    Button

    14
  • Notification Button

    Notification Button

    117
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Eclipse Button

    Eclipse Button

    44
  • Button Save

    Button Save

    50
  • App Store Button

    App Store Button

    484
  • Base Button

    Base Button

    1