Date Range Picker

Start and end date range picker made from two labelled date inputs. Works controlled or uncontrolled and returns a from and to object for filters and reports.

src/registry/ui/date-range-picker.tsx/r/date-range-picker.json

Installation#

bash
npx shadcn@latest add @minidev/date-range-picker

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/date-range-picker.json

Usage#

tsx
import { DateRangePicker } from "@/components/ui/date-range-picker"

export function Example() {
  return (
    <DateRangePicker fromId="dr-from" toId="dr-to" />
  )
}

API reference#

DateRangePicker props
PropTypeDefault
value{ from?: string; to?: string }-
onChange(value: { from?: string; to?: string }) => void-
disabledboolean-
classNamestring-
fromIdstring-
toIdstring-

Dependencies#

npm

React only

Built from

Examples#

All form components

Learn more