Skip to content

Browse components

← All components

Date Range Picker

Popover that picks a start and end date.

Install
npx shadcn@latest add https://ui.anuragroy.dev/r/date-range-picker.json

Preview

Loading preview…

Installation

Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.

Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/date-range-picker.json

GitHub fallback if the website is down:

Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/date-range-picker.json

Usage

Import paths follow your components.json aliases. After install, the default path is @/components/ui/date-range-picker.

Import
import { DateRangePicker } from "@/components/ui/date-range-picker"
example.tsx
import { DateRangePicker } from "@/components/ui/date-range-picker"export function Example() {  return <DateRangePicker />}

API Reference

DateRangePicker

PropTypeDefault
valueDateRange—
defaultValueDateRange—
onValueChange(range) => void—
placeholderstring"Pick a date range"
disabledboolean—
dateFormatstring"LLL dd, y"
numberOfMonthsnumber2
  • numberOfMonths — Months shown in the popover calendar.