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

    472
  • Chip

    Chip

    449
  •  The Pagination

    The Pagination

    369
  • HeroUI Table

    HeroUI Table

    124
  • HeroUI Color Picker

    HeroUI Color Picker

    115
  • Skeleton

    Skeleton

    108
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    98
  • HeroUI AlertDialog

    HeroUI AlertDialog

    85

More in Buttons

View all
  • Button

    Button

    166
  • Texture Button

    Texture Button

    121
  • Button

    Button

    21
  • Figma File Button

    Figma File Button

    39
  • Native Button

    Native Button

    12
  • Button

    Button

    88
  • HeroUI Button Group

    HeroUI Button Group

    11
  • Great UI Button

    Great UI Button

    19