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

    465
  • Chip

    Chip

    440
  •  The Pagination

    The Pagination

    361
  • HeroUI Color Picker

    HeroUI Color Picker

    105
  • Skeleton

    Skeleton

    104
  • HeroUI Table

    HeroUI Table

    100
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    94
  • HeroUI AlertDialog

    HeroUI AlertDialog

    80

More in Buttons

View all
  • Button

    Button

    14
  • Button

    Button

    34
  • Texture Button

    Texture Button

    92
  • Button Save

    Button Save

    46
  • Button

    Button

    64
  • Button Group

    Button Group

    3
  • App Store Button

    App Store Button

    454
  • Notification Button

    Notification Button

    103