Appearance

Sizes

Four built-in sizes: small, medium, large, and x-large.

import { useState } from "react";
import { DatePicker } from "react-date-range-picker-tailwind4";
import type { DatePickerSize } from "react-date-range-picker-headless";
const sizes: DatePickerSize[] = ["small", "medium", "large", "x-large"];
function Sizes() {
const [values, setValues] = useState<Record<DatePickerSize, Date | null>>({
small: null,
medium: null,
large: null,
"x-large": null,
});
return (
<div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
{sizes.map((size) => (
<div key={size} style={{ display: "flex", alignItems: "center", gap: 12 }}>
<span style={{ width: 60, fontSize: 13, fontWeight: 600, opacity: 0.5, flexShrink: 0 }}>
{size}
</span>
<DatePicker
value={values[size]}
onChange={(date) => setValues((prev) => ({ ...prev, [size]: date }))}
size={size}
/>
</div>
))}
</div>
);
}
small
medium
large
x-large

Custom Format

Customize the display format string.

import { useState } from "react";
import { DatePicker } from "react-date-range-picker-tailwind4";
function CustomFormat() {
const [value, setValue] = useState<Date | null>(null);
return <DatePicker value={value} onChange={setValue} displayFormat="YYYY/MM/DD" />;
}

Custom Locale

Provide a custom locale for internationalization using createLocale from the headless package.

import { useState } from "react";
import { DatePicker } from "react-date-range-picker-tailwind4";
import { createLocale } from "react-date-range-picker-headless";
const koLocale = createLocale("ko-KR", {
confirm: "확인",
cancel: "취소",
clear: "초기화",
today: "오늘",
placeholder: "날짜 선택",
});
function CustomLocale() {
const [value, setValue] = useState<Date | null>(null);
return <DatePicker value={value} onChange={setValue} locale={koLocale} weekStartsOn="monday" />;
}

Week Starts On

Change the first day of the week. Defaults to "sunday".

import { useState } from "react";
import { DatePicker } from "react-date-range-picker-tailwind4";
function WeekStartsOn() {
const [value, setValue] = useState<Date | null>(null);
return <DatePicker value={value} onChange={setValue} weekStartsOn="monday" />;
}

Show Outside Days

Display days from adjacent months to fill the calendar grid. Defaults to false.

import { useState } from "react";
import { DatePicker } from "react-date-range-picker-tailwind4";
function ShowOutsideDays() {
const [value, setValue] = useState<Date | null>(null);
return <DatePicker value={value} onChange={setValue} showOutsideDays />;
}

Caption Dropdown

Switch the month/year navigation from arrows to dropdowns with captionLayout="dropdown". Use fromYear and toYear to set the year range.

import { useState } from "react";
import { DatePicker } from "react-date-range-picker-tailwind4";
function CaptionDropdown() {
const [value, setValue] = useState<Date | null>(null);
return (
<DatePicker
value={value}
onChange={setValue}
captionLayout="dropdown"
fromYear={2020}
toYear={2030}
/>
);
}