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

    466
  • Chip

    Chip

    441
  •  The Pagination

    The Pagination

    361
  • HeroUI Table

    HeroUI Table

    106
  • HeroUI Color Picker

    HeroUI Color Picker

    106
  • Skeleton

    Skeleton

    105
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    94
  • HeroUI AlertDialog

    HeroUI AlertDialog

    80

More in Buttons

View all
  • Button Group

    Button Group

    2
  • App Store Button

    App Store Button

    457
  • Eclipse Button

    Eclipse Button

    6
  • Texture Button

    Texture Button

    95
  • Button

    Button

    5
  • Button Save

    Button Save

    47
  • Base Button

    Base Button

    3
  • HeroUI Button Group

    HeroUI Button Group