Constraints

Min & Max Days

Restrict the range length with minDays and maxDays (inclusive). Users cannot confirm a range shorter than minDays or longer than maxDays.

import { useState } from "react";
import { DateRangePicker } from "react-date-range-picker-tailwind3";
function MinMaxDays() {
const [value, setValue] = useState<{ start: Date | null; end: Date | null }>({
start: null,
end: null,
});
return <DateRangePicker value={value} onChange={setValue} minDays={3} maxDays={14} />;
}

Disabled Dates

Use isDateUnavailable to dynamically disable specific dates. Disabled dates cannot be selected as start or end of a range.

import { useState } from "react";
import { DateRangePicker } from "react-date-range-picker-tailwind3";
function DisabledDates() {
const [value, setValue] = useState<{ start: Date | null; end: Date | null }>({
start: null,
end: null,
});
const isDateUnavailable = (date: Date) => {
const day = date.getDay();
return day === 0 || day === 6; // Disable weekends
};
return (
<DateRangePicker value={value} onChange={setValue} isDateUnavailable={isDateUnavailable} />
);
}

Allow Single Date

By default, a range where start equals end is allowed. Set allowSingleDateInRange={false} to require at least two distinct dates.

import { useState } from "react";
import { DateRangePicker } from "react-date-range-picker-tailwind3";
function AllowSingleDate() {
const [value, setValue] = useState<{ start: Date | null; end: Date | null }>({
start: null,
end: null,
});
return <DateRangePicker value={value} onChange={setValue} allowSingleDateInRange={false} />;
}